0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 07:13:08 -05:00

Always fire pathChange event on selection change

This lets you reliably hook into the pathChange event to know when
to recalculate button state for bold, italic, etc.

Resolves #465
This commit is contained in:
Neil Jenkins 2024-08-16 15:59:43 +10:00
parent aa29157969
commit 671319d316

View file

@ -710,7 +710,7 @@ class Squire {
? this._getPath(focus) ? this._getPath(focus)
: '(selection)' : '(selection)'
: ''; : '';
if (this._path !== newPath) { if (this._path !== newPath || anchor !== focus) {
this._path = newPath; this._path = newPath;
this.fireEvent('pathChange', { this.fireEvent('pathChange', {
path: newPath, path: newPath,