You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Merge pull request #112251 from bruvzg/grab_ac
Fix `grab_focus` incorrectly handling `FOCUS_ACCESSIBILITY`.
This commit is contained in:
@@ -2349,6 +2349,13 @@ void Control::grab_focus(bool p_hide_focus) {
|
||||
ERR_MAIN_THREAD_GUARD;
|
||||
ERR_FAIL_COND(!is_inside_tree());
|
||||
|
||||
if (get_focus_mode_with_override() == FOCUS_ACCESSIBILITY) {
|
||||
if (!get_tree()->is_accessibility_enabled()) {
|
||||
WARN_PRINT("This control can grab focus only when screen reader is active. Use set_focus_mode() and set_focus_behavior_recursive() to allow a control to get focus. Use get_tree().is_accessibility_enabled() to check screen-reader state.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (get_focus_mode_with_override() == FOCUS_NONE) {
|
||||
WARN_PRINT("This control can't grab focus. Use set_focus_mode() and set_focus_behavior_recursive() to allow a control to get focus.");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user