Skip to content

Commit

Permalink
Properly set accessible value on label nodes (bevyengine#16418)
Browse files Browse the repository at this point in the history
# Objective

AccessKit/accesskit#475 changed how text content
should be set for AccessKit nodes with a role of `Label`. This was
unfortunately missing from bevyengine#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.
  • Loading branch information
DataTriny authored and ecoskey committed Dec 2, 2024
1 parent a650b82 commit cfb0296
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/bevy_ui/src/accessibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cfb0296

Please sign in to comment.