EditorPropertyText misbehavior for LineEdit with text
longer than max_length
#50243
Labels
Milestone
text
longer than max_length
#50243
Godot version
4.0.dev (7428c07)
System information
Linux, Mageia 9 x86_64
Issue description
When editing a
LineEdit
'stext
property in the Inspector with a non-zeromax_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.
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
LineEdit
, setmax_length
to something like 10text
property to reach max length (e.g. "Hello world")Minimal reproduction project
LineEdit-max_length-caret.zip
The text was updated successfully, but these errors were encountered: