You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: Remove custom hit testing in usePress (#7427)
* refactor: Remove custom hit testing in usePress
* Only allow dragging to select an item with mouse, not touch
* Don't close when dragging outside submenu
Copy file name to clipboardexpand all lines: packages/@react-aria/selection/src/useSelectableItem.ts
+7-3
Original file line number
Diff line number
Diff line change
@@ -241,7 +241,7 @@ export function useSelectableItem(options: SelectableItemOptions): SelectableIte
241
241
}
242
242
};
243
243
244
-
// If allowsDifferentPressOrigin, make selection happen on pressUp (e.g. open menu on press down, selection on menu item happens on press up.)
244
+
// If allowsDifferentPressOrigin and interacting with mouse, make selection happen on pressUp (e.g. open menu on press down, selection on menu item happens on press up.)
245
245
// Otherwise, have selection happen onPress (prevents listview row selection when clicking on interactable elements in the row)
246
246
if(!allowsDifferentPressOrigin){
247
247
itemPressProps.onPress=(e)=>{
@@ -257,12 +257,16 @@ export function useSelectableItem(options: SelectableItemOptions): SelectableIte
0 commit comments