Skip to content

Commit 08d929c

Browse files
authored
Fix annotation input focus trap regression in Safari
`setSelectionRange(0, 0)` added in mozilla@44b24fc for mozilla#12359, required only by Firefox ([bug](https://bugzilla.mozilla.org/show_bug.cgi?id=860329)), causes issues mozilla#13191, mozilla#12592 in Safari. `scrollLeft = 0` is a fix that breaks the focus trap in Safari while **keeping Firefox behavior same for mozilla#12359**.
1 parent 6eee9b6 commit 08d929c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/display/annotation_layer.js

+1
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,7 @@ class TextWidgetAnnotationElement extends WidgetAnnotationElement {
668668
if (elementData.formattedValue) {
669669
event.target.value = elementData.formattedValue;
670670
}
671+
// Reset the cursor position to the start of the field (issue 12359).
671672
event.target.scrollLeft = 0;
672673
elementData.beforeInputSelectionRange = null;
673674
};

0 commit comments

Comments
 (0)