@react-aria/interactions 3.0.0-nightly.1356 → 3.0.0-nightly.1368
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/main.js +5 -2
- package/dist/main.js.map +1 -1
- package/dist/module.js +5 -2
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/usePress.ts +11 -3
package/dist/main.js
CHANGED
|
@@ -202,7 +202,7 @@ function $b6038ba7cfc7e443$export$45712eceda6fad21(props) {
|
|
|
202
202
|
let pressProps = {
|
|
203
203
|
onKeyDown (e) {
|
|
204
204
|
if ($b6038ba7cfc7e443$var$isValidKeyboardEvent(e.nativeEvent) && e.currentTarget.contains(e.target)) {
|
|
205
|
-
e.preventDefault();
|
|
205
|
+
if ($b6038ba7cfc7e443$var$shouldPreventDefaultKeyboard(e.target)) e.preventDefault();
|
|
206
206
|
e.stopPropagation();
|
|
207
207
|
// If the event is repeating, it may have started on a different element
|
|
208
208
|
// after which focus moved to the current element. Ignore these events and
|
|
@@ -241,7 +241,7 @@ function $b6038ba7cfc7e443$export$45712eceda6fad21(props) {
|
|
|
241
241
|
};
|
|
242
242
|
let onKeyUp = (e)=>{
|
|
243
243
|
if (state.isPressed && $b6038ba7cfc7e443$var$isValidKeyboardEvent(e)) {
|
|
244
|
-
e.preventDefault();
|
|
244
|
+
if ($b6038ba7cfc7e443$var$shouldPreventDefaultKeyboard(e.target)) e.preventDefault();
|
|
245
245
|
e.stopPropagation();
|
|
246
246
|
state.isPressed = false;
|
|
247
247
|
let target = e.target;
|
|
@@ -539,6 +539,9 @@ function $b6038ba7cfc7e443$var$shouldPreventDefault(target) {
|
|
|
539
539
|
// We cannot prevent default if the target is inside a draggable element.
|
|
540
540
|
return !target.closest('[draggable="true"]');
|
|
541
541
|
}
|
|
542
|
+
function $b6038ba7cfc7e443$var$shouldPreventDefaultKeyboard(target) {
|
|
543
|
+
return !((target.tagName === 'INPUT' || target.tagName === 'BUTTON') && target.type === 'submit');
|
|
544
|
+
}
|
|
542
545
|
function $b6038ba7cfc7e443$var$isVirtualPointerEvent(event) {
|
|
543
546
|
// If the pointer size is zero, then we assume it's from a screen reader.
|
|
544
547
|
// Android TalkBack double tap will sometimes return a event with width and height of 1
|