File tree 2 files changed +10
-1
lines changed
packages/core/src/engines
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @use-gesture/core ' : patch
3
+ ---
4
+
5
+ fix: don't let Enter key preventDefault on onClick when filterTaps is true.
Original file line number Diff line number Diff line change @@ -252,7 +252,11 @@ export class DragEngine extends CoordinatesEngine<'drag'> {
252
252
}
253
253
254
254
pointerClick ( event : MouseEvent ) {
255
- if ( ! this . state . tap ) {
255
+ // event.detail indicates the number of buttons being pressed. When it's
256
+ // null, it's likely to be a keyboard event from the Enter Key that could
257
+ // be used for accessibility, and therefore shouldn't be prevented.
258
+ // See https://github.com/pmndrs/use-gesture/issues/530
259
+ if ( ! this . state . tap && event . detail > 0 ) {
256
260
event . preventDefault ( )
257
261
event . stopPropagation ( )
258
262
}
You can’t perform that action at this time.
0 commit comments