Skip to content

Commit

Permalink
Merge pull request #1090 from basecamp/caret-move-ios-17
Browse files Browse the repository at this point in the history
Fix caret move on iOS 17
  • Loading branch information
Alberto Fernández-Capel authored Sep 22, 2023
2 parents ade9bc0 + 52dd480 commit 9b70218
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/trix/observers/selection_change_observer.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ export default class SelectionChangeObserver extends BasicObject {

update() {
const domRange = getDOMRange()
if (!domRangesAreEqual(domRange, this.domRange)) {
const caretMove = window.getSelection().type === "Caret"

if (!domRangesAreEqual(domRange, this.domRange) || caretMove) {
this.domRange = domRange
return this.notifySelectionManagersOfSelectionChange()
}
Expand Down

0 comments on commit 9b70218

Please sign in to comment.