vira 28.19.0 → 28.19.1
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/util/pop-up-manager.js +33 -12
- package/package.json +1 -1
|
@@ -93,6 +93,21 @@ export class PopUpManager {
|
|
|
93
93
|
this.removePopUp();
|
|
94
94
|
}
|
|
95
95
|
else if (this.options.supportNavigation) {
|
|
96
|
+
/**
|
|
97
|
+
* Check if the event target is a text input element. If so, allow horizontal
|
|
98
|
+
* arrow keys to pass through for cursor navigation within the input.
|
|
99
|
+
*/
|
|
100
|
+
const target = event.target;
|
|
101
|
+
const isTextInput = (target instanceof HTMLInputElement &&
|
|
102
|
+
(target.type === 'text' ||
|
|
103
|
+
target.type === 'search' ||
|
|
104
|
+
target.type === 'email' ||
|
|
105
|
+
target.type === 'url' ||
|
|
106
|
+
target.type === 'tel' ||
|
|
107
|
+
target.type === 'password' ||
|
|
108
|
+
target.type === 'number')) ||
|
|
109
|
+
target instanceof HTMLTextAreaElement ||
|
|
110
|
+
(target instanceof HTMLElement && target.isContentEditable);
|
|
96
111
|
if (keyCode === 'ArrowDown') {
|
|
97
112
|
event.stopImmediatePropagation();
|
|
98
113
|
event.preventDefault();
|
|
@@ -110,20 +125,26 @@ export class PopUpManager {
|
|
|
110
125
|
});
|
|
111
126
|
}
|
|
112
127
|
else if (keyCode === 'ArrowLeft') {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
128
|
+
/** Allow left arrow in text inputs for cursor navigation. */
|
|
129
|
+
if (!isTextInput) {
|
|
130
|
+
event.stopImmediatePropagation();
|
|
131
|
+
event.preventDefault();
|
|
132
|
+
this.navController.navigate({
|
|
133
|
+
direction: NavDirection.Left,
|
|
134
|
+
allowWrapping: false,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
119
137
|
}
|
|
120
138
|
else if (keyCode === 'ArrowRight') {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
139
|
+
/** Allow right arrow in text inputs for cursor navigation. */
|
|
140
|
+
if (!isTextInput) {
|
|
141
|
+
event.stopImmediatePropagation();
|
|
142
|
+
event.preventDefault();
|
|
143
|
+
this.navController.navigate({
|
|
144
|
+
direction: NavDirection.Right,
|
|
145
|
+
allowWrapping: false,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
127
148
|
}
|
|
128
149
|
else if ((keyCode === 'Enter' || keyCode === 'Return' || keyCode === 'Space') &&
|
|
129
150
|
this.navController.enterInto({ fallbackToActivate: true }).success) {
|