Skip to content
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

Merged
merged 7 commits into from
Jun 26, 2024

Conversation

DataTriny
Copy link
Contributor

No description provided.

@DataTriny DataTriny force-pushed the accessible-placeholder-text branch from d89cb12 to 06d9b6d Compare June 23, 2024 13:30
@DataTriny DataTriny force-pushed the accessible-placeholder-text branch from 06d9b6d to cf17ae0 Compare June 23, 2024 13:57
Copy link
Member

@ogoffart ogoffart left a 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?

@@ -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()) {
Copy link
Member

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?

Copy link
Contributor Author

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.

@DataTriny
Copy link
Contributor Author

I tried passing features -DSLING_FEATURE_TESTING -DSLING_BUILD_EXAMPLES -DSLINT_FEATURE_EXPERIMENTAL when compiling with CMAKE yet ctest -C Debug only runs 7 tests, not including the ones from the todo example. Unless I am missing something, the CI job logs provide no additional information.

I give up, sorry!

@tronical
Copy link
Member

I tried passing features -DSLING_FEATURE_TESTING -DSLING_BUILD_EXAMPLES -DSLINT_FEATURE_EXPERIMENTAL when compiling with CMAKE yet ctest -C Debug only runs 7 tests, not including the ones from the todo example. Unless I am missing something, the CI job logs provide no additional information.

I give up, sorry!

No worries, I can try tomorrow and fix it.

Copy link
Member

@tronical tronical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you :)

@tronical tronical merged commit ce2db77 into slint-ui:master Jun 26, 2024
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants