revert some changes
This commit is contained in:
@@ -105,11 +105,7 @@ export function Outer({
|
|||||||
export function Item({children, label, style, onPress, ...rest}: ItemProps) {
|
export function Item({children, label, style, onPress, ...rest}: ItemProps) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {control} = React.useContext(Context)
|
const {control} = React.useContext(Context)
|
||||||
const {
|
const {state: focused, onIn: onFocus, onOut: onBlur} = useInteractionState()
|
||||||
state: focused,
|
|
||||||
onIn: onHoverIn,
|
|
||||||
onOut: onHoverOut,
|
|
||||||
} = useInteractionState()
|
|
||||||
const {
|
const {
|
||||||
state: pressed,
|
state: pressed,
|
||||||
onIn: onPressIn,
|
onIn: onPressIn,
|
||||||
@@ -121,9 +117,15 @@ export function Item({children, label, style, onPress, ...rest}: ItemProps) {
|
|||||||
{...rest}
|
{...rest}
|
||||||
accessibilityHint=""
|
accessibilityHint=""
|
||||||
accessibilityLabel={label}
|
accessibilityLabel={label}
|
||||||
|
onFocus={onFocus}
|
||||||
|
onBlur={onBlur}
|
||||||
onPress={e => {
|
onPress={e => {
|
||||||
control?.close()
|
control?.close()
|
||||||
onPress(e)
|
onPress(e)
|
||||||
|
|
||||||
|
if (!e.defaultPrevented) {
|
||||||
|
control?.close()
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
onPressIn={e => {
|
onPressIn={e => {
|
||||||
onPressIn()
|
onPressIn()
|
||||||
@@ -133,8 +135,6 @@ export function Item({children, label, style, onPress, ...rest}: ItemProps) {
|
|||||||
onPressOut()
|
onPressOut()
|
||||||
rest.onPressOut?.(e)
|
rest.onPressOut?.(e)
|
||||||
}}
|
}}
|
||||||
onHoverIn={onHoverIn}
|
|
||||||
onHoverOut={onHoverOut}
|
|
||||||
style={[
|
style={[
|
||||||
a.flex_row,
|
a.flex_row,
|
||||||
a.align_center,
|
a.align_center,
|
||||||
|
|||||||
Reference in New Issue
Block a user