-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Change mode switcher to a select box #389
Conversation
editor/header/mode-switcher/index.js
Outdated
this.state = { | ||
opened: false | ||
value: this.props.mode |
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.
We don't want to duplicate the source of truth from state. We'll simply want the render
logic to use the prop directly. I'll plan to refactor this afternoon.
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.
Also failing on this accessibility lint rule: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-onchange.md |
My linter actually caught this, but when I tested |
Depending on what the lint rule is trying to suggest (in this case a less immediate feedback from toggling through options) we may consider simply bypassing or removing the rule altogether, or applying both an |
For now I've disabled the rule with reasoning left inline. I'll plan to create a separate "Accessibility Review" issue to discuss the case, as |
background: white; | ||
select { | ||
background: transparent; | ||
line-height: 1; |
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.
No linting to capture it, but we ought to be cautious of mixed spacing in SCSS files.
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.
Just wanted to let you know that I really appreciate this and very much taking notes. Thanks for pushing fixes too.
Nesting input to defeat specificity of general `.wp-admin select` selector
This PR changes the mode switcher from a custom JS thing to be a common selectbox, although heavily styled. The benefit is that you can click/hold the select box and release it on the option you want, making it easier to switch. It would also be more flexible if a plugin wanted to, say, add Markdown as an option.
GIF:
This will need a review, especially the React bits.