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

Android virtual keyboard doesn't respect max length of LineEdit #32709

Closed
KoBeWi opened this issue Oct 10, 2019 · 1 comment · Fixed by #35438
Closed

Android virtual keyboard doesn't respect max length of LineEdit #32709

KoBeWi opened this issue Oct 10, 2019 · 1 comment · Fixed by #35438

Comments

@KoBeWi
Copy link
Member

KoBeWi commented Oct 10, 2019

Godot version:
3.2 alpha

OS/device including version:
Android 7 on Xiaomi Redmi Note 4

Issue description:
When you set a maximum length for LineEdit, it works alright on desktop, but on Android you can write past the limit. It won't appear in the LineEdit, but the extra letters will show on virtual keyboard.
image
What's worse, doing "Backspace" has no effect in LineEdit until you remove all the extra letters.

Minimal reproduction project:
ReproductionProject.zip

@MadEqua
Copy link
Contributor

MadEqua commented Jan 17, 2020

Is iOS behaving differently?

I can fix this on Android this by adding a max_input_length parameter to OS::show_virtual_keyboard()

virtual void show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2());

passing it into Java land to an InputFilter used when requesting a keyboard. This should stop the soft keyboard apps to accept any number of characters.

Other implementations of OS::show_virtual_keyboard() (iOS and UWP, I think) will just ignore the new parameter.

@akien-mga akien-mga modified the milestones: 3.2, 4.0 Jan 22, 2020
@akien-mga akien-mga added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jan 22, 2020
@akien-mga akien-mga modified the milestones: 4.0, 3.2 Jan 23, 2020
@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants