Skip to content

Commit

Permalink
Always fire pathChange event on selection change
Browse files Browse the repository at this point in the history
This lets you reliably hook into the pathChange event to know when
to recalculate button state for bold, italic, etc.

Resolves #465
  • Loading branch information
neilj committed Aug 16, 2024
1 parent aa29157 commit 671319d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ class Squire {
? this._getPath(focus)
: '(selection)'
: '';
if (this._path !== newPath) {
if (this._path !== newPath || anchor !== focus) {
this._path = newPath;
this.fireEvent('pathChange', {
path: newPath,
Expand Down

0 comments on commit 671319d

Please sign in to comment.