Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Try using snackbar notices instead of prominent ones for saving/failure notices #15594
Try using snackbar notices instead of prominent ones for saving/failure notices #15594
Changes from 13 commits
bd07cde
36f8419
7f6992e
b94bfcc
dde6c7a
0faf67d
e0a1ea2
cd90b4c
a8f465e
daefc52
24a0584
95b919a
8d9ac40
cd0eafc
a566adf
82a6994
8172262
c4ea9ab
2a28fd9
6f4a1d5
266cff1
b2b47ed
b0b9fa4
fc5408c
12cde84
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 think it would be a good idea to start adding "Accessibility guidelines" to all these component READMEs similar to dev and design. cc @audrasjb @LukePettway
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.
That's a great idea!
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.
This rule doesn't account for React Hooks. It should be possible to use and cancel timeouts in useEffect or other hooks.
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.
Tracked here #15622
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.
Doesn't have to be done in this pull, but one thing that could get around having to use the effect rule exclusion here is to create a
useTimeout
hook that components like this can use (and the only place the es-lint rule would need skipped is in with that custom hook definition).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.
Interesting, I can see how this can be useful. Maybe we could try it once we find a second use-case?
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.
Those notices are announced with
wp.a11y.speak
method like all other types of notices. They are also automatically being dismissed after 10 seconds. Do they really need to be focusable? What are the odds that keyboard-only user will want to tab to this message to dismiss it before it gets removed?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.
Yes, no strong opinions from me but I had this feedback earlier.
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.
Should it be wrapped with an e2e test util to simplify usage in different places? It might be too early, but at least I can see the value of having a local function which simplifies his logic.
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.
Ya I agree, it'd be handy to have a test util for verifying notices appear (would be good if it allows for notice type as well as content in the signature).
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 assuming this mixin is not needed anymore if you want to center them
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.
👍 Definitely had no clue what this was for. 😜