Skip to content

Commit

Permalink
Prevent errors on UnitControl drag gesture
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Mar 22, 2021
1 parent a20a3bb commit 2d8eb63
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/components/src/input-control/input-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ function InputField(
const dragGestureProps = useDrag(
( dragProps ) => {
const { distance, dragging, event } = dragProps;
// The event is persisted to prevent errors in components using this
// to check if a modifier key was held while dragging.
event.persist();

if ( ! distance ) return;
event.stopPropagation();
Expand Down

0 comments on commit 2d8eb63

Please sign in to comment.