Skip to content

Commit

Permalink
fix: Call model.announce in setCaretPosition
Browse files Browse the repository at this point in the history
  • Loading branch information
stefnotch committed Sep 14, 2020
1 parent 5786072 commit acadaa5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/editor/mathfield-class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -932,8 +932,10 @@ export class MathfieldPrivate implements Mathfield {
: null;
}
setCaretPosition(x: number, y: number): boolean {
const oldPath = this.model.clone();
const anchor = pathFromPoint(this, x, y, { bias: 0 });
const result = setPath(this.model, anchor, 0);
this.model.announce('move', oldPath);
requestUpdate(this);
return result;
}
Expand Down

0 comments on commit acadaa5

Please sign in to comment.