+2 votes

I'm creating linedits every time I press a button and I want to make it so just as it's created it gets focused and ready to type in without any more inputs. I've tried grab_focus and grab_click_focus but it doesn't seem to work. How can I achieve this result?

in Engine by (235 points)
edited by

1 Answer

+1 vote

Related: https://godotengine.org/qa/8355/button-set-focus

$LineEdit.grab_focus()
by (46 points)

As I said on my post I already tried those, but it ended up not been fault of the grab_focus but some problem with the theme I was using. Using the same settings but using the costume style instead of the theme works just fine, idk if it's a bug or what.

Hi! Sorry for commenting on such an old post, but I have the same issue and I don't know where else to ask. If you still remember, could you please elaborate on what causes the issue? I don't really understand what you meant by "using the costume style instead of the theme".

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories