-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
ha-form-multi_select accessibility improvements #21023
ha-form-multi_select accessibility improvements #21023
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
I'm pretty busy today and tomorrow, but I'll review sometime this weekend. |
I've been dealing with some data loss because of a Docker update, but I'll get to this soon. |
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
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.
Looking good on the material 3 part. Sooner or later we may want to move the keydown listener to the button menu component so this gets accesible wherever the component is used.
src/components/ha-button-menu-new.ts
Outdated
private _handleOpening(): void { | ||
fireEvent(this, "opening", undefined, { bubbles: false }); | ||
} | ||
|
||
private _handleClosing(): void { | ||
fireEvent(this, "closing", undefined, { bubbles: false }); | ||
} |
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.
Why do we re-fire these, are they originally fired un-composed? And why do we disable bubbling, should we also fire them un-composed then instead if disabling bubbling?
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.
Why do we re-fire these, are they originally fired un-composed?
It's been a while, but I think I recall that was the issue.
And why do we disable bubbling, should we also fire them un-composed then instead if disabling bubbling?
I am not so knowledgeable about this. I mostly got it working via guessing/trial & error. Can try something else if you have a better suggestion.
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'm surprised they fire un-composed, but ok 🤷♂️ I suggest we do the same then.
fireEvent(this, "closing", undefined, { composed: false });
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.
seems to work, updated
Proposed change
The current multi_select control (combobox variant) for ha-form is very poorly accessible:
I have attempted to rewrite this part to improve this. I initially tried fixing it with the existing components (I think it's material 2?), but I wasn't successful in getting something to work. I then spent a little time trying it with the newer material 3 components, and I think I got something satisfactory:
I am fairly new with dealing with complex usage of material components, or anything accessibility related, so a lot of this was just guessing and trial and error, so I may have done some things incorrectly.
Sample screenshot:
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed:
Summary by CodeRabbit
New Features
Refactor
ha-svg-icon
withha-icon-button
for better icon handling.ha-check-list-item
toha-menu-item
for options rendering in multi-select forms.