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

Tooltips appear inconsistently on Chrome and Safari #8040

Closed
afercia opened this issue Jul 18, 2018 · 4 comments
Closed

Tooltips appear inconsistently on Chrome and Safari #8040

afercia opened this issue Jul 18, 2018 · 4 comments
Labels
Browser Issues Issues or PRs that are related to browser specific problems [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Testing Needs further testing to be confirmed. [Type] Bug An existing feature does not function as intended

Comments

@afercia
Copy link
Contributor

afercia commented Jul 18, 2018

Can't reproduce this with Firefox, seems it happens only in Chrome and Safari. Haven't tested Edge and IE11 on Windows.

When hovering buttons, sometimes the tooltips don't appear as expected. For example, hovering the "Info" button in the top bar makes the tooltip "Content Structure:" appear:

screen shot 2018-07-18 at 19 59 44

After that, depending on where the mouse pointer is moved, the tooltips of other buttons don't appear. To reproduce in Chrome or Safari:

  • hover the "Info" button
  • the tooltip appears
  • move the mouse pointer horizontally to the "Plus" button on the left, making sure the mouse pointer stays within the area highlighted below while moving:

screen shot 2018-07-18 at 19 59 53

  • once on the "Plus" button, its tooltip doesn't appear (works with Firefox)
  • repeat the steps above but this time move the mouse pointer outside the highlighted area before hovering the other button
  • the tooltip appears correctly

When the Undo or Redo buttons are enabled, the behavior is slightly different but still not 100% correct (repeat the steps above multiple times and at some point, it will fail).

Wild guess: events propagating to some wrapper element?

@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). labels Jul 18, 2018
@designsimply designsimply added the Browser Issues Issues or PRs that are related to browser specific problems label Jul 18, 2018
@afercia
Copy link
Contributor Author

afercia commented Jul 19, 2018

Ok so this has to do with the issue mentioned in the inline comment in the tooltip component: facebook/react#4251

Chrome and Safari don't fire the mouseleave event on disabled buttons. Not sure if React uses internally mouseleave or mouseout but it doesn't work regardless. For the four buttons in the screenshot above, when Undo and Redo are disabled, tooltips can't work correctly.

However, this is also partially related to the implementation: there's a delay for the isOver state and these four buttons have no space between them. Spacing them helps (I've tried adding some margin for testing purposes) but it wouldn't be a proper solution.

Some exploration for a different approach would be very welcome.

@karmatosed
Copy link
Member

There are some inconsistency reports worth combining into this from here: #11180

@afercia
Copy link
Contributor Author

afercia commented Feb 26, 2019

Needs to be retested: as far as I know, these buttons are not really disabled now.

@afercia afercia added the Needs Testing Needs further testing to be confirmed. label Feb 26, 2019
@afercia
Copy link
Contributor Author

afercia commented Feb 26, 2019

Since these buttons no longer use disabled and use instead aria-disabled, the mouseleave event now works as expected. Tested in Chrome / Safari, the tooltips appear consistently.

An unintended, welcomed, consequence of #11379 and other changes to the other buttons. And one more reason to use aria-disabled + noop where it makes sense. /Cc @aduth

@afercia afercia closed this as completed Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Browser Issues Issues or PRs that are related to browser specific problems [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Testing Needs further testing to be confirmed. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants