You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-31 18:41:20 +00:00
Accessibility: Re-apply stored name when recreating nodes in _ensure_node
When TabContainer calls accessibility_update_add_related_controls(), it triggers _ensure_node() which creates a new AccessKit node. Since the node pointer was nulled after the previous tree update push, this creates an empty node without any properties. TabBar only sets tab properties (name, bounds) when accessibility_item_dirty is true. After initial setup, dirty=false, so recreated nodes would be pushed without names, causing screen readers to announce "page tab" without the tab name. This fix re-applies the stored name (and name_extra_info) when _ensure_node creates a new node, ensuring tab names persist across node recreations.
This commit is contained in:
@@ -612,6 +612,13 @@ _FORCE_INLINE_ void AccessibilityDriverAccessKit::_ensure_node(const RID &p_id,
|
||||
|
||||
wd->update.insert(p_id);
|
||||
p_ae->node = accesskit_node_new(p_ae->role);
|
||||
|
||||
// Re-apply stored name if any, so nodes recreated by _ensure_node
|
||||
// retain their label even if the caller doesn't re-set all properties.
|
||||
if (!p_ae->name.is_empty() || !p_ae->name_extra_info.is_empty()) {
|
||||
String full_name = p_ae->name + " " + p_ae->name_extra_info;
|
||||
accesskit_node_set_label(p_ae->node, full_name.utf8().ptr());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user