Fix sensitivity while scrolling (#3190)
parent
9f2f7f221c
commit
5c771050bc
|
@ -119,6 +119,10 @@ export function Trigger({children, label}: TriggerProps) {
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
...props,
|
...props,
|
||||||
|
// disable on web, use `onPress`
|
||||||
|
onPointerDown: () => false,
|
||||||
|
onPress: () =>
|
||||||
|
control.isOpen ? control.close() : control.open(),
|
||||||
onFocus: onFocus,
|
onFocus: onFocus,
|
||||||
onBlur: onBlur,
|
onBlur: onBlur,
|
||||||
onMouseEnter,
|
onMouseEnter,
|
||||||
|
|
|
@ -23,6 +23,10 @@ export type RadixPassThroughTriggerProps = {
|
||||||
['aria-haspopup']?: boolean
|
['aria-haspopup']?: boolean
|
||||||
['aria-expanded']?: AccessibilityProps['aria-expanded']
|
['aria-expanded']?: AccessibilityProps['aria-expanded']
|
||||||
onKeyDown: (e: React.KeyboardEvent) => void
|
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']
|
onPointerDown: PressableProps['onPointerDown']
|
||||||
}
|
}
|
||||||
export type TriggerProps = {
|
export type TriggerProps = {
|
||||||
|
@ -69,6 +73,7 @@ export type TriggerChildProps =
|
||||||
pressed: false
|
pressed: false
|
||||||
}
|
}
|
||||||
props: RadixPassThroughTriggerProps & {
|
props: RadixPassThroughTriggerProps & {
|
||||||
|
onPress: () => void
|
||||||
onFocus: () => void
|
onFocus: () => void
|
||||||
onBlur: () => void
|
onBlur: () => void
|
||||||
onMouseEnter: () => void
|
onMouseEnter: () => void
|
||||||
|
|
Loading…
Reference in New Issue