Skip to content

Commit

Permalink
EPUB/Snapshot: Fix cycling between >2 overlapping annotations
Browse files Browse the repository at this point in the history
No need for a *good* sort function as long as it keeps things stable
between renders.
  • Loading branch information
AbeJellinek committed Nov 12, 2024
1 parent 7e5e447 commit 06c0b01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dom/common/dom-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,8 @@ abstract class DOMView<State extends DOMViewState, Data> {
private _getAnnotationsAtPoint(clientX: number, clientY: number): string[] {
return this._annotationShadowRoot.elementsFromPoint(clientX, clientY)
.map(target => target.getAttribute('data-annotation-id'))
.filter(Boolean) as string[];
.filter(Boolean)
.sort() as string[];
}

private _handleAnnotationDragStart = (id: string, dataTransfer: DataTransfer) => {
Expand Down

0 comments on commit 06c0b01

Please sign in to comment.