-
Notifications
You must be signed in to change notification settings - Fork 88
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
fix(NcRichContenteditable): make autocomplete accessible #4904
Conversation
23fdbae
to
16d225f
Compare
- Fixes `Tribute was already bound to DIV` warning - Tribute is supposed to be only once on the element - Simplifies further work with Tribute Signed-off-by: Grigorii K. Shartsev <[email protected]>
- `smilesList` is always a constant and reused across all the instances - tribute options are used only once to initialize tribute Signed-off-by: Grigorii K. Shartsev <[email protected]>
- Correctly implement `debounced` method, so that debouncedFunction properties are available and each component instance has its own debounce - Clear debounce on autoComplete close Signed-off-by: Grigorii K. Shartsev <[email protected]>
98b6a12
to
5a90fc3
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.
tested and works with screen reader!
8ac2eba
to
f91c871
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.
Awesome work! 🚀
Signed-off-by: Grigorii K. Shartsev <[email protected]>
Signed-off-by: Grigorii K. Shartsev <[email protected]>
f91c871
to
66034a3
Compare
// Setup integration only once on the first open | ||
if (this.isTributeIntegrationDone) { | ||
return | ||
} | ||
this.isTributeIntegrationDone = true |
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 only thing added during the force push.
To set up integration only once after the first open, not each time.
Sorry for a fast merge, rushing to get this in the tomorrow's release. Feel free to review merged, I'll have a look. |
…editable--a11y-tribute fix(NcRichContenteditable): make autocomplete accessible
…editable--a11y-tribute fix(NcRichContenteditable): make autocomplete accessible
☑️ Resolves
The solution may look a bit complex with dirty places, but I see no better solution except forking
Tribute.js
.Complex parts with tribute:
tribute-active-true
does not respect async loadingactivedescendant
tribute-active-true
event. Tribute is supposed to be used only once on elementcontainerClass
is not updating on opening another collection (known Tribute.js issue)refactor(NcRichContenteditable): create 1 tribute for all autocompletes
Tribute was already bound to DIV
warningrefactor(NcRichContenteditable): move constants out of reactive data
Not required, but simplifies work with actual component's state.
smilesList
is always a constant and reused across all the instancesrefactor(NcRichContenteditable): cancel autoComplete on close
debounced
method, so thatdebouncedFunction
properties are available and each component instance has its owndebounce
.debounced
is not valid in Vue. In this case, we have 1 shared debounce for all component instances.autoComplete
closefix(NcRichContenteditable): make autocomplete accessible
aria-*
attributes to thecontenteditable
aria-activedescendant
to connect with the current selected element from autocompletelistbox
+option
instead of nativelist
+listitem
list
doesn't work as a list of options for screen readerfix(NcRichContenteditable): provide focus-visible class
:focus-visible
🖼️ Screenshots
🏁 Checklist