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

Fix/issue 11669 block icon #12554

Closed

Conversation

timwright12
Copy link
Contributor

Description

Fixes #11669

How has this been tested?

  • Linting
  • Browser testing
  • Local e2e
  • Local Unit

Types of changes

Converted disabled block icon buttons to a span so can can be semantically presentational and removed from assistive technology.

Checklist:

  • [ x ] My code is tested.
  • [ x ] My code follows the WordPress code style.
  • [ x ] My code follows the accessibility standards.
  • [ x ] My code has proper inline documentation.

Copy link
Member

@jorgefilipecosta jorgefilipecosta left a 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:
screenshot 2018-12-05 at 12 57 11

className="editor-block-switcher__no-switcher-icon"
label={ __( 'Block icon' ) }
>
<div className="components-toolbar" aria-hidden="true">
Copy link
Member

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.

Copy link
Member

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:

Suggested change
<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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

label={ __( 'Block icon' ) }
>
<div className="components-toolbar" aria-hidden="true">
<span className="components-icon-button editor-block-switcher__no-switcher-icon is-presentational">
Copy link
Member

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.

Copy link
Contributor Author

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!

@jorgefilipecosta jorgefilipecosta added the [Type] Enhancement A suggestion for improvement. label Dec 5, 2018
@jorgefilipecosta jorgefilipecosta added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Design Feedback Needs general design feedback. Needs Accessibility Feedback Need input from accessibility labels Dec 5, 2018
Copy link
Member

@tofumatt tofumatt left a 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">
Copy link
Member

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:

Suggested change
<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.

@tofumatt tofumatt removed the request for review from afercia December 5, 2018 14:04
@afercia
Copy link
Contributor

afercia commented Jan 30, 2019

@jorgefilipecosta hi, was going through the issues with the "Needs accessibility feedback" label: what kind of feedback is needed here?

@jorgefilipecosta
Copy link
Member

@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.

Copy link
Member

@gziolo gziolo left a 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,
Copy link
Member

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">
Copy link
Member

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.

@gziolo gziolo added this to the 5.1 (Gutenberg) milestone Feb 6, 2019
@afercia
Copy link
Contributor

afercia commented Feb 23, 2019

From an accessibility perspective, looks good to me.

@afercia afercia removed the Needs Accessibility Feedback Need input from accessibility label Feb 23, 2019
@youknowriad youknowriad removed this from the 5.3 (Gutenberg) milestone Mar 18, 2019
@mapk
Copy link
Contributor

mapk commented Apr 5, 2019

Looks like this has been fixed with #13721 so I'm closing this PR. If I missed anything we can reopen if needed.

@mapk mapk closed this Apr 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants