fix(iced): a11y tree focus

This commit is contained in:
Ashley Wulber 2024-11-25 00:52:32 -05:00 committed by GitHub
parent 9a8a56952d
commit a9c7c3cdbf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

2
iced

@ -1 +1 @@
Subproject commit 501d7aaebe113a785f53e3f139e48be8a6dd4d1a
Subproject commit 630612a7b1cb4fb236edabb2dee88b1754976549

View file

@ -116,7 +116,7 @@ impl<'a, Message: Clone + 'static> From<Button<'a, Message>> for Element<'a, Mes
.into()
});
let button: super::Button<'a, Message> = row::with_capacity(3)
let mut button: super::Button<'a, Message> = row::with_capacity(3)
// Optional icon to place before label.
.push_maybe(leading_icon)
// Optional label between icons.
@ -134,6 +134,13 @@ impl<'a, Message: Clone + 'static> From<Button<'a, Message>> for Element<'a, Mes
.on_press_maybe(builder.on_press.take())
.class(builder.class);
#[cfg(feature = "a11y")]
{
if !builder.label.is_empty() {
button = button.name(builder.label);
}
}
if builder.tooltip.is_empty() {
button.into()
} else {