-
Notifications
You must be signed in to change notification settings - Fork 604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the accessible-placeholder-text
property
#5464
Add the accessible-placeholder-text
property
#5464
Conversation
d89cb12
to
06d9b6d
Compare
06d9b6d
to
cf17ae0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this nice PR.
Note that the TextEdit also has a placeholder.
My question is whether we should really remove the placeholder if there is a value? Shouldn't the client take care of displaying that?
And if we really should, perhaps it should be the widget responsibility to do accessible-placeholder-text: text == "" ? "" : placeholder-text;
What do you think?
internal/backends/winit/accesskit.rs
Outdated
@@ -437,7 +437,16 @@ impl NodeCollection { | |||
builder.set_numeric_value_step(step); | |||
} | |||
|
|||
if let Some(value) = item.accessible_string_property(AccessibleStringProperty::Value) { | |||
let value = item.accessible_string_property(AccessibleStringProperty::Value); | |||
if value.is_none() || value.as_ref().is_some_and(|x| x.is_empty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this logic shouldn't be better done in the .slint code itself.
Or is there really a reason you can't have a value and a placeholder text at the same time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests I performed with both NVDA and Narrator on Windows revealed that the placeholder would still be announced even when the widget had some text. Maybe this is due to Slint not yet implementing editable text, tests will have to be done once you get there.
I tried passing features I give up, sorry! |
No worries, I can try tomorrow and fix it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you :)
No description provided.