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

EditorPropertyText misbehavior for LineEdit with text longer than max_length #50243

Closed
akien-mga opened this issue Jul 7, 2021 · 1 comment · Fixed by #67393
Closed

EditorPropertyText misbehavior for LineEdit with text longer than max_length #50243

akien-mga opened this issue Jul 7, 2021 · 1 comment · Fixed by #67393

Comments

@akien-mga
Copy link
Member

Godot version

4.0.dev (7428c07)

System information

Linux, Mageia 9 x86_64

Issue description

When editing a LineEdit's text property in the Inspector with a non-zero max_length property, a weird wrap around of the caret happens when hitting the max length. The caret jumps to the first column each time you attempt to input a new char that exceeds the max length.

This also triggers the unexpected behavior that new keypresses will insert characters at the start of the string and it's the end of the pre-existing string which gets truncated.

Peek 2021-07-07 13-30

Expected behavior would be that the caret would stay at its current position (and the excess char would still not be inserted, as it can't fit).

See #50200 (comment) for details, the problem seems to be due to #44971 which prevents updates when the text doesn't change. And since the Inspector refreshes and not update is sent, the caret position might be reset?

We'd need to find a different fix for #42488 if we want to keep sending updates for actions that don't modify the text.

CC @pouleyKetchoupp

Steps to reproduce

  • Add LineEdit, set max_length to something like 10
  • Type enough text in the text property to reach max length (e.g. "Hello world")
  • See the caret go back to 0 when you exceed the max length

Minimal reproduction project

LineEdit-max_length-caret.zip

@pouleyKetchoupp
Copy link
Contributor

Good news:
#44971 is not needed anymore to fix #42488 on master since #45879 is changing the inspector to poll updated properties, so it can be safely reverted now if needed.

Bad news:
From what I've tested, reverting this fix doesn't fully solve the max_length issue. The caret is still being reset to the beginning when max_length is reached.

@KoBeWi KoBeWi moved this to To Assess in 4.x Priority Issues Jun 4, 2022
@KoBeWi KoBeWi moved this from To Assess to Todo in 4.x Priority Issues Jun 4, 2022
@KoBeWi KoBeWi moved this from Todo to In Progress in 4.x Priority Issues Oct 14, 2022
Repository owner moved this from In Progress to Done in 4.x Priority Issues Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants