Skip to content

UI GUI Navigation documentation is incorrect #10136

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

Open
okachobi opened this issue Oct 23, 2024 · 1 comment · May be fixed by #10938
Open

UI GUI Navigation documentation is incorrect #10136

okachobi opened this issue Oct 23, 2024 · 1 comment · May be fixed by #10938
Labels
area:manual Issues and PRs related to the Manual/Tutorials section of the documentation bug content:example code Issues and PRs involving code examples topic:gui

Comments

@okachobi
Copy link

Your Godot version:
4.3

Issue description:
Section entitled "Necessary code" is incorrect or godot has a bug. A VBoxContainer was created in a scene with a root Control node. the VBoxContainer contains 4 buttons with a custom theme set. The Control has a script:

func _ready():
	$StartButton.grab_focus()

The scene was instantiated and added to an active scene that has a Node2D root node.

This does not appear to result in the StartButton taking focus. Instead, it appears it is necessary to set focus somewhere in _process() or with a timer signal.

URL to the documentation page:
Necessary code

@okachobi okachobi added the bug label Oct 23, 2024
@okachobi
Copy link
Author

Suggest that this be changed to:

func _ready():
	$StartButton.grab_focus.call_deferred()

@tetrapod00 tetrapod00 added area:manual Issues and PRs related to the Manual/Tutorials section of the documentation topic:gui content:example code Issues and PRs involving code examples labels Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:manual Issues and PRs related to the Manual/Tutorials section of the documentation bug content:example code Issues and PRs involving code examples topic:gui
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants