We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b86d1f3 commit cf05d0dCopy full SHA for cf05d0d
assets/global.js
@@ -68,6 +68,12 @@ function trapFocus(container, elementToFocus = container) {
68
document.addEventListener('focusin', trapFocusHandlers.focusin);
69
70
elementToFocus.focus();
71
+
72
+ if (elementToFocus.tagName === 'INPUT' &&
73
+ ['search', 'text', 'email', 'url'].includes(elementToFocus.type) &&
74
+ elementToFocus.value) {
75
+ elementToFocus.setSelectionRange(0, elementToFocus.value.length);
76
+ }
77
}
78
79
// Here run the querySelector to figure out if the browser supports :focus-visible or not and run code based on it.
0 commit comments