Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard does not show up automatically when using Dialog.Input on Android #153

Open
micpob opened this issue Jan 8, 2023 · 3 comments
Open
Labels
bug Something isn't working

Comments

@micpob
Copy link

micpob commented Jan 8, 2023

Environment

0.70.5

Platforms

Android

Description

Even if I set autoFocus={true} on Dialog.Input, when the dialog opens the keyboard will not appear until I click on the input field.

Reproducible Demo

<Dialog.Container visible={showAddTagForm} onBackdropPress={handleCancel} onRequestClose={handleCancel}>
<Dialog.Input
autoFocus={true}
autoCapitalize='none'
maxLength={35}
onChangeText={onChangeText}
onSubmitEditing={() => handleSubmit(newTag)}
value={newTag}
placeholder="Add new tag here"
/>
<Dialog.Button label="Cancel" onPress={handleCancel} />
<Dialog.Button label="OK" onPress={() => handleSubmit(newTag)} />
</Dialog.Container>

@micpob micpob added the bug Something isn't working label Jan 8, 2023
@micpob
Copy link
Author

micpob commented Jan 9, 2023

I noticed that the issue does not happens and the keyboard is showed automatically if you render the Dialog.Container component conditionally (in my case with showAddTagForm && <Dialog.Container>) instead of just relying on the visible prop.

@ReeceKenney
Copy link

Also seeing this. When using it for apps on non touch devices (chromecast, tv etc.) I don't see a way to bring the keyboard up as I can't click into the textbox

@pachun
Copy link

pachun commented Mar 11, 2024

Dialog.Input also accepts all the React-Native's TextInput component props.

Try adding the autoFocus prop to your Dialog.Input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants