-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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/issue 11669 block icon #12554
Fix/issue 11669 block icon #12554
Conversation
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.
Hi @timwright12, thank you for your contribution I left some suggestions regarding the code.
From the functional and design point of view I think things look as expected only the opacity was removed:
className="editor-block-switcher__no-switcher-icon" | ||
label={ __( 'Block icon' ) } | ||
> | ||
<div className="components-toolbar" aria-hidden="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.
We are using the class of a component outside of it in another element. I guess in this case we should use a different class and add the minimum necessary styles to have a similar UI.
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.
As mentioned this should be:
<div className="components-toolbar" aria-hidden="true"> | |
<div className="components-block-switcher" aria-hidden="true"> |
As mentioned by Jorge you'll need to duplicate some styles from components-toolbar
, I'd imagine, to get this to work.
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.
@jorgefilipecosta @tofumatt All set here
label={ __( 'Block icon' ) } | ||
> | ||
<div className="components-toolbar" aria-hidden="true"> | ||
<span className="components-icon-button editor-block-switcher__no-switcher-icon is-presentational"> |
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.
Same as in the toolbar case we should avoid the usage of components-icon-button class as it is internal to another component in another package.
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.
@jorgefilipecosta @tofumatt All set here as well. Let me know if you find anything else. Thanks for the feedback!
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 classnames need to change here but the implementation seems solid and makes sense to me, so once we get the classnames sorted out this should be good 👍
className="editor-block-switcher__no-switcher-icon" | ||
label={ __( 'Block icon' ) } | ||
> | ||
<div className="components-toolbar" aria-hidden="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.
As mentioned this should be:
<div className="components-toolbar" aria-hidden="true"> | |
<div className="components-block-switcher" aria-hidden="true"> |
As mentioned by Jorge you'll need to duplicate some styles from components-toolbar
, I'd imagine, to get this to work.
@jorgefilipecosta hi, was going through the issues with the "Needs accessibility feedback" label: what kind of feedback is needed here? |
Hi @afercia, I guess we just need to compare with the previous version and check if the main objective was accomplished: The disable block icon is semantically presentational and is removed from assistive technologies. |
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 left my comments. I also noticed that this PR needs to be refreshed with the latest changes from the master
branch.
.components-icon-button.editor-block-switcher__toggle, | ||
.components-icon-button.editor-block-switcher__no-switcher-icon { | ||
margin: 0; | ||
.components-icon-button.editor-block-switcher__no-switcher-icon, |
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.
.editor-block-switcher__no-switcher-icon
class is getting removed so should be removed from this file, too.
className="editor-block-switcher__no-switcher-icon" | ||
label={ __( 'Block icon' ) } | ||
> | ||
<div className="components-block-switcher" aria-hidden="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.
I don't think, we should be re-creating Toolbar
here as this is still the same div
.
From an accessibility perspective, looks good to me. |
Looks like this has been fixed with #13721 so I'm closing this PR. If I missed anything we can reopen if needed. |
Description
Fixes #11669
How has this been tested?
Types of changes
Converted disabled block icon buttons to a span so can can be semantically presentational and removed from assistive technology.
Checklist: