Compare commits

...

1 Commits

Author SHA1 Message Date
Eric Bailey 394cadc470 Fix sensitivity while scrolling 2024-03-12 17:25:06 -05:00
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -119,6 +119,10 @@ export function Trigger({children, label}: TriggerProps) {
},
props: {
...props,
// disable on web, use `onPress`
onPointerDown: () => false,
onPress: () =>
control.isOpen ? control.close() : control.open(),
onFocus: onFocus,
onBlur: onBlur,
onMouseEnter,
+5
View File
@@ -23,6 +23,10 @@ export type RadixPassThroughTriggerProps = {
['aria-haspopup']?: boolean
['aria-expanded']?: AccessibilityProps['aria-expanded']
onKeyDown: (e: React.KeyboardEvent) => void
/**
* Radix provides this, but we override on web to use `onPress` instead,
* which is less sensitive while scrolling.
*/
onPointerDown: PressableProps['onPointerDown']
}
export type TriggerProps = {
@@ -69,6 +73,7 @@ export type TriggerChildProps =
pressed: false
}
props: RadixPassThroughTriggerProps & {
onPress: () => void
onFocus: () => void
onBlur: () => void
onMouseEnter: () => void