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

Allow extra attrs provided to <Select> to be passed through to the DOM element #2959

Merged
merged 3 commits into from
Jul 13, 2021

Conversation

davwheat
Copy link
Member

@davwheat davwheat commented Jul 12, 2021

Changes proposed in this pull request:

  • Extra attrspassed to the Select component are given straight to the DOM element
    • This is critical for accessibility. Currently, there is no way to provide a11y attrs (such as for, id, aria-described-by, etc.) to the DOM element.
  • Custom class names can be provided to the outer wrapping element for easier customisability
  • Custom attrs can also be passed to the wrapper via the wrapperAttrs attr

Reviewers should focus on:

Should we allow a way to pass any attrs wanted to the outer element, too? Something like a wrapperAttrs attribute? Done!

Confirmed

  • Frontend changes: tested on a local Flarum installation.
  • Backend changes: tests are green (run composer test).

@davwheat davwheat added the type/accessibility Issues relating to accessibility (keyboard navigation, screenreaders, text contrast, etc.) label Jul 12, 2021
@davwheat davwheat added this to the 1.0.5 milestone Jul 12, 2021
@davwheat davwheat self-assigned this Jul 12, 2021
@dsevillamartin
Copy link
Member

Should we allow a way to pass any attrs wanted to the outer element, too? Something like a wrapperAttrs attribute?

This sounds like a good idea.

@davwheat
Copy link
Member Author

This sounds like a good idea.

@datitisev Implemented!

@davwheat
Copy link
Member Author

I'll fix formatting in a second.

@davwheat davwheat merged commit 3130e3d into master Jul 13, 2021
@davwheat davwheat deleted the dw/select-attr-passthrough branch July 13, 2021 12:42
@SychO9 SychO9 modified the milestones: 1.0.5, 1.1 Aug 25, 2021
@davwheat davwheat mentioned this pull request Mar 28, 2022
28 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/accessibility Issues relating to accessibility (keyboard navigation, screenreaders, text contrast, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants