@primer/behaviors 0.0.0-20251028164041 → 0.0.0-20251028165442
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/focus-zone.js
CHANGED
|
@@ -84,20 +84,18 @@ function shouldIgnoreFocusHandling(keyboardEvent, activeElement) {
|
|
|
84
84
|
const key = keyboardEvent.key;
|
|
85
85
|
const keyLength = [...key].length;
|
|
86
86
|
const isEditable = isEditableElement.isEditableElement(activeElement);
|
|
87
|
-
const isSelect = activeElement instanceof HTMLSelectElement;
|
|
88
87
|
if (isEditable && (keyLength === 1 || key === 'Home' || key === 'End')) {
|
|
89
88
|
return true;
|
|
90
89
|
}
|
|
91
|
-
if (
|
|
90
|
+
if (activeElement instanceof HTMLSelectElement) {
|
|
92
91
|
if (key === 'ArrowDown' && userAgent.isMacOS() && !keyboardEvent.metaKey) {
|
|
93
92
|
return true;
|
|
94
93
|
}
|
|
95
94
|
if (key === 'ArrowDown' && !userAgent.isMacOS() && keyboardEvent.altKey) {
|
|
96
95
|
return true;
|
|
97
96
|
}
|
|
98
|
-
return false;
|
|
99
97
|
}
|
|
100
|
-
if (isEditable
|
|
98
|
+
if (isEditable) {
|
|
101
99
|
const isInputElement = activeElement instanceof HTMLTextAreaElement || activeElement instanceof HTMLInputElement;
|
|
102
100
|
const cursorAtStart = isInputElement && activeElement.selectionStart === 0 && activeElement.selectionEnd === 0;
|
|
103
101
|
const cursorAtEnd = isInputElement &&
|
package/dist/esm/focus-zone.mjs
CHANGED
|
@@ -82,20 +82,18 @@ function shouldIgnoreFocusHandling(keyboardEvent, activeElement) {
|
|
|
82
82
|
const key = keyboardEvent.key;
|
|
83
83
|
const keyLength = [...key].length;
|
|
84
84
|
const isEditable = isEditableElement(activeElement);
|
|
85
|
-
const isSelect = activeElement instanceof HTMLSelectElement;
|
|
86
85
|
if (isEditable && (keyLength === 1 || key === 'Home' || key === 'End')) {
|
|
87
86
|
return true;
|
|
88
87
|
}
|
|
89
|
-
if (
|
|
88
|
+
if (activeElement instanceof HTMLSelectElement) {
|
|
90
89
|
if (key === 'ArrowDown' && isMacOS() && !keyboardEvent.metaKey) {
|
|
91
90
|
return true;
|
|
92
91
|
}
|
|
93
92
|
if (key === 'ArrowDown' && !isMacOS() && keyboardEvent.altKey) {
|
|
94
93
|
return true;
|
|
95
94
|
}
|
|
96
|
-
return false;
|
|
97
95
|
}
|
|
98
|
-
if (isEditable
|
|
96
|
+
if (isEditable) {
|
|
99
97
|
const isInputElement = activeElement instanceof HTMLTextAreaElement || activeElement instanceof HTMLInputElement;
|
|
100
98
|
const cursorAtStart = isInputElement && activeElement.selectionStart === 0 && activeElement.selectionEnd === 0;
|
|
101
99
|
const cursorAtEnd = isInputElement &&
|