From 59863d3e8cf8b5961860242e7e1dc949f64e37b1 Mon Sep 17 00:00:00 2001 From: Arnold Loubriat Date: Sun, 17 Nov 2024 19:10:41 +0100 Subject: [PATCH] Properly set accessible value on label nodes (#16418) # Objective https://github.com/AccessKit/accesskit/pull/475 changed how text content should be set for AccessKit nodes with a role of `Label`. This was unfortunately missing from #16234. ## Solution When building an `accesskit::Node` with `Role::Label`, calls `set_value` instead of `set_label` on the node to set its content. ## Testing I can't test this right now on my Windows machine due to a compilation error with wgpu-hal I have no idea how to resolve. --- crates/bevy_ui/src/accessibility.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bevy_ui/src/accessibility.rs b/crates/bevy_ui/src/accessibility.rs index d67babc411..95686530ce 100644 --- a/crates/bevy_ui/src/accessibility.rs +++ b/crates/bevy_ui/src/accessibility.rs @@ -133,14 +133,14 @@ fn label_changed( if let Some(mut accessible) = accessible { accessible.set_role(Role::Label); if let Some(label) = label { - accessible.set_label(label); + accessible.set_value(label); } else { - accessible.clear_label(); + accessible.clear_value(); } } else { let mut node = Node::new(Role::Label); if let Some(label) = label { - node.set_label(label); + node.set_value(label); } commands .entity(entity)