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

Regression: LineEdit loses focus after hitting enter. #100230

Closed
jitspoe opened this issue Dec 10, 2024 · 6 comments · Fixed by #100240
Closed

Regression: LineEdit loses focus after hitting enter. #100230

jitspoe opened this issue Dec 10, 2024 · 6 comments · Fixed by #100240

Comments

@jitspoe
Copy link
Contributor

jitspoe commented Dec 10, 2024

Tested versions

  • Reproducible in 4.4-dev6.
  • Doesn't happen in 4.3 stable.

System information

Godot v4.4.dev6 - Windows 10.0.19045 - Multi-window, 2 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3080 (NVIDIA; 32.0.15.6603) - AMD Ryzen 7 3700X 8-Core Processor (16 threads)

Issue description

If you have a line edit and type something then press enter, you can no longer type in the edit box until you re-focus it by clicking or pressing enter again.

Steps to reproduce

  • Add a LineEdit to the scene.
  • Type in the line edit.
  • Press enter.
  • Note that you can't type anymore.

(Very obvious with the dev console addon. You can only type one command at a type).

Minimal reproduction project (MRP)

test_console.zip

@Sauermann
Copy link
Contributor

Sauermann commented Dec 10, 2024

@akien-mga
Copy link
Member

CC @WhalesState @KoBeWi

@akien-mga akien-mga moved this from Unassessed to Bad in 4.x Release Blockers Dec 10, 2024
@WhalesState
Copy link
Contributor

This feature was added to prevent the focus loss of the LineEdit when pressing Escape button, a workaround for now is to use LineEdit.edit().call_deferred() when text is submitted, and also i can add a variable keep_editing_on_text_submitted.

@KoBeWi
Copy link
Member

KoBeWi commented Dec 10, 2024

Yeah this is not really a regression, but a behavior change. The LineEdit is still usable.
I think adding keep_editing_on_text_submitted to easily preserve the old behavior makes sense.

@WhalesState
Copy link
Contributor

WhalesState commented Dec 10, 2024

Yeah this is not really a regression, but a behavior change. The LineEdit is still usable. I think adding keep_editing_on_text_submitted to easily preserve the old behavior makes sense.

To avoid setting it to true for all the LineEdit nodes in editor, i have defaulted it to false for game (to avoid causing regression) and to true for editor and editor plugins.

but I think it should be true by default for both since it only cause regression for console like input fields, check this #97088.

@jitspoe
Copy link
Contributor Author

jitspoe commented Dec 11, 2024

This feature was added to prevent the focus loss of the LineEdit when pressing Escape button, a workaround for now is to use LineEdit.edit().call_deferred() when text is submitted, and also i can add a variable keep_editing_on_text_submitted.

Not quite sure I understand -- the issue happens even if there's no callbacks for the lineedit. You can just throw one in a scene and press enter and it loses focus. Also, is the losing of focus on enter necessary to stop losing focus on escape? Guess I don't fully understand the intent here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Bad
Development

Successfully merging a pull request may close this issue.

5 participants