react-native-dialog-input
react-native-dialog-input copied to clipboard
Clicking one of the buttons when keyboard is up
When clicking on one of the buttons while keyboard is up (only tested on android), it simply closes the keyboard. Resulting in having to click again to hit the actual button.
Any workaround for this?
I'd like to know if there is a workaround for this also
Figured it out.
Look for the ScrollView
element that has the Dialogue element as its child, nested component.
Set,
<ScrollView
keyboardShouldPersistTaps="handled"
{...props}>
. . . . . .
<Dialogue {...props} />
. . . . . .
The issue is that the ScrollView
is consuming the tap, passing the keyboardShouldPersistTaps
prop fixes it.
Thanks @mkhoussid I will try this later today!
It works! Thank you @mkhoussid But when keyboard is up - it is quite difficult to hit the button at first try. Do you experience that? It is possible to hit it, but it seams easier to hit on 2. try (when keyboard is down).
Keyboard being up or down isn't the issue. Try this:
<TouchableOpacity
onPress={() =>{alert("pressed!")}}
>
<View style={styles.myStyle}>
// This is an example of an icon I use,
// but you could use any other icon
<Icon
name="md-add"
type="ionicon"
/>
</View>
</TouchableOpacity>
Let me know if that works. Or when you say "it is difficult to hit the button", you mean it's already a <Button />
element and it's hard to hit?