diff options
author | Minseo Lee <itoupluk427@gmail.com> | 2024-03-10 22:50:48 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-10 22:50:48 +0900 |
commit | 236223d02aa61d8f9011c7484c4e8827d336ecb6 (patch) | |
tree | 2e4ac0c8581a942332447a041b28dd5fa608e283 /src/view/com/util/EventStopper.tsx | |
parent | e74c46e9ab480959c4416f83a78289e460bdeec7 (diff) | |
parent | 1aaed1cc0d59ecafa1bb3c7f57f0a323940e6317 (diff) | |
download | voidsky-236223d02aa61d8f9011c7484c4e8827d336ecb6.tar.zst |
Merge branch 'bluesky-social:main' into patch-3
Diffstat (limited to 'src/view/com/util/EventStopper.tsx')
-rw-r--r-- | src/view/com/util/EventStopper.tsx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/view/com/util/EventStopper.tsx b/src/view/com/util/EventStopper.tsx index e743e89bb..8f5f5cf54 100644 --- a/src/view/com/util/EventStopper.tsx +++ b/src/view/com/util/EventStopper.tsx @@ -8,7 +8,14 @@ import {View, ViewStyle} from 'react-native' export function EventStopper({ children, style, -}: React.PropsWithChildren<{style?: ViewStyle | ViewStyle[]}>) { + onKeyDown = true, +}: React.PropsWithChildren<{ + style?: ViewStyle | ViewStyle[] + /** + * Default `true`. Set to `false` to allow onKeyDown to propagate + */ + onKeyDown?: boolean +}>) { const stop = (e: any) => { e.stopPropagation() } @@ -18,7 +25,7 @@ export function EventStopper({ onTouchEnd={stop} // @ts-ignore web only -prf onClick={stop} - onKeyDown={stop} + onKeyDown={onKeyDown ? stop : undefined} style={style}> {children} </View> |