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

Backspace doesn't work properly in TextEdit on Android #44416

Closed
pouleyKetchoupp opened this issue Dec 16, 2020 · 1 comment · Fixed by #44423
Closed

Backspace doesn't work properly in TextEdit on Android #44416

pouleyKetchoupp opened this issue Dec 16, 2020 · 1 comment · Fixed by #44423

Comments

@pouleyKetchoupp
Copy link
Contributor

Godot version:
Master 92d4dee

OS/device including version:
Android 11 (Pixel 3)

Issue description:
After leaving and entering again a TextEdit control on Android, erasing the previously entered text doesn't work.

There's an error in the log when the virtual keyboard is triggered:

ERROR: TextEdit::_base_get_text: Index p_to_column = 5 is out of bounds (text[p_to_line].length() + 1 = 5).
   At: scene\gui\text_edit.cpp:4018

On this line in the new code:

String text = _base_get_text(0, 0, selection.selecting_line, selection.selecting_column);

I can confirm selection.selecting_column is 5 and not 4 in this scenario by debugging step by step on Windows (and forcing the virtual keyboard path).

This issue seems to be due to #43561 (CC @naithar)

Steps to reproduce:

  1. Launch MRP (or create a scene with TextEdit and LineEdit)
  2. Select the TextEdit control
  3. Type abcd
  4. Select the LineEdit control
    5.Select the TextEdit control again (after abcd)
  5. Press backspace on the virtual keyboard
  6. Observe backspace is not working

Minimal reproduction project:
android-ui-4.0.zip

@naithar
Copy link
Contributor

naithar commented Dec 16, 2020

naithar@efeb9e4 - I've ported latest commit from #43560 PR.
It should fix this issue. I'll try to test it tomorrow and make a PR for master.

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