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

Settings button: missing tooltip #7510

Closed
afercia opened this issue Jun 23, 2018 · 4 comments
Closed

Settings button: missing tooltip #7510

afercia opened this issue Jun 23, 2018 · 4 comments
Assignees
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release
Milestone

Comments

@afercia
Copy link
Contributor

afercia commented Jun 23, 2018

The "Settings" button in the top bar used to have a tooltip displayed on hover and focus. This is how it looked like in Gutenberg 2.5:

screen shot 2018-06-23 at 16 24 45

On current master, no tooltip is displayed at all:

no tooltip

Aside:
the hover style is different too, not sure if that's intentional; if so, it should go in a separate issue though.

@afercia afercia added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Regression Related to a regression in the latest release labels Jun 23, 2018
@afercia
Copy link
Contributor Author

afercia commented Jun 23, 2018

Looks like the DotTip added for the NUX prevents the tooltip from working correctly. As soon as I remove it, the tooltip is back. I think this ie because IconButtons are supposed to not use tooltips when they have children, assuming the child is some visible text in the button?

@afercia
Copy link
Contributor Author

afercia commented Jun 23, 2018

One option could be forcing the tooltip to appear, passing both the label and tooltip props:

label={ __( 'Settings' ) }
tooltip={ __( 'Settings' ) }

However, when the DotTips render, there's also a JS warning:
Warning: validateDOMNesting(...): <button> cannot appear as a descendant of <button>.

to my understanding, although the "tips" use a popover component, the "Settings" tip contains a couple buttons and it's "hooked" within the Settings IconButton so apparently validateDOMNesting evaluates the nesting statically?

Regardless, moving the DotTip outside of the IconButton and wrapping both in a wrapper element could solve both issues.

@designsimply
Copy link
Member

Tested and confirmed that hovering over the post settings gear icon does not result in showing a tooltip.

screen shot 2018-06-25 at mon jun 25 4 52 06 pm
Seen at http://alittletestblog.com/wp-admin/post-new.php running WordPress 4.9.6 and Gutenberg 3.1.0 using Firefox 60.0.2 on macOS 10.13.5.

@afercia
Copy link
Contributor Author

afercia commented Jul 21, 2018

Just realized also the tooltip of the side inserter "Add block" button doesn't appear on hover any longer, for the same reason. To reproduce:

  • create a new post
  • hover on the "Write your story" area and then on the "plus" button

screen shot 2018-07-21 at 19 54 12

Actually, the DotTip passed as child to the Inserter ends up being a child of the IconButton rendered by Inserter. The IconButton component doesn't render a tooltip when it has children (because it assumes the children are visible button content), unless the tooltip is forced with the tooltip prop.

Worth reminding forcing the tooltip prop wouldn't solve the validateDOMNesting warning.

I'd suggest to give this issue higher priority, as the implementation of the NUX tips actually broke the tooltips behavior.

@jorgefilipecosta jorgefilipecosta self-assigned this Jul 24, 2018
@designsimply designsimply added this to the 3.4 milestone Jul 25, 2018
@pento pento modified the milestones: 3.4, 3.5 Jul 30, 2018
@gziolo gziolo modified the milestones: 3.5, 3.6 Aug 8, 2018
@youknowriad youknowriad modified the milestones: 3.6, 3.7 Aug 15, 2018
@jorgefilipecosta jorgefilipecosta added the [Status] In Progress Tracking issues with work in progress label Aug 27, 2018
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). [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

No branches or pull requests

6 participants