@primer/behaviors 0.0.0-20250829152615 → 0.0.0-20251027175934

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.
@@ -97,15 +97,16 @@ function shouldIgnoreFocusHandling(keyboardEvent, activeElement) {
97
97
  }
98
98
  if (isEditable) {
99
99
  const isInputElement = activeElement instanceof HTMLTextAreaElement || activeElement instanceof HTMLInputElement;
100
- const cursorAtStart = isInputElement && activeElement.selectionStart === 0 && activeElement.selectionEnd === 0;
101
- const cursorAtEnd = isInputElement &&
102
- activeElement.selectionStart === activeElement.value.length &&
103
- activeElement.selectionEnd === activeElement.value.length;
104
- if (key === 'ArrowLeft' && !cursorAtStart) {
105
- return true;
106
- }
107
- if (key === 'ArrowRight' && !cursorAtEnd) {
108
- return true;
100
+ if (isInputElement) {
101
+ const cursorAtStart = activeElement.selectionStart === 0 && activeElement.selectionEnd === 0;
102
+ const cursorAtEnd = activeElement.selectionStart === activeElement.value.length &&
103
+ activeElement.selectionEnd === activeElement.value.length;
104
+ if (key === 'ArrowLeft' && !cursorAtStart) {
105
+ return true;
106
+ }
107
+ if (key === 'ArrowRight' && !cursorAtEnd) {
108
+ return true;
109
+ }
109
110
  }
110
111
  const isContentEditable = activeElement instanceof HTMLElement && activeElement.isContentEditable;
111
112
  if (activeElement instanceof HTMLTextAreaElement || isContentEditable) {
@@ -95,15 +95,16 @@ function shouldIgnoreFocusHandling(keyboardEvent, activeElement) {
95
95
  }
96
96
  if (isEditable) {
97
97
  const isInputElement = activeElement instanceof HTMLTextAreaElement || activeElement instanceof HTMLInputElement;
98
- const cursorAtStart = isInputElement && activeElement.selectionStart === 0 && activeElement.selectionEnd === 0;
99
- const cursorAtEnd = isInputElement &&
100
- activeElement.selectionStart === activeElement.value.length &&
101
- activeElement.selectionEnd === activeElement.value.length;
102
- if (key === 'ArrowLeft' && !cursorAtStart) {
103
- return true;
104
- }
105
- if (key === 'ArrowRight' && !cursorAtEnd) {
106
- return true;
98
+ if (isInputElement) {
99
+ const cursorAtStart = activeElement.selectionStart === 0 && activeElement.selectionEnd === 0;
100
+ const cursorAtEnd = activeElement.selectionStart === activeElement.value.length &&
101
+ activeElement.selectionEnd === activeElement.value.length;
102
+ if (key === 'ArrowLeft' && !cursorAtStart) {
103
+ return true;
104
+ }
105
+ if (key === 'ArrowRight' && !cursorAtEnd) {
106
+ return true;
107
+ }
107
108
  }
108
109
  const isContentEditable = activeElement instanceof HTMLElement && activeElement.isContentEditable;
109
110
  if (activeElement instanceof HTMLTextAreaElement || isContentEditable) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/behaviors",
3
- "version": "0.0.0-20250829152615",
3
+ "version": "0.0.0-20251027175934",
4
4
  "description": "Shared behaviors for JavaScript components",
5
5
  "type": "commonjs",
6
6
  "main": "dist/cjs/index.js",