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

HeadingLevelDropdown: tooltip for a menu item obscures the next item #55927

Closed
jsnajdr opened this issue Nov 7, 2023 · 4 comments
Closed

HeadingLevelDropdown: tooltip for a menu item obscures the next item #55927

jsnajdr opened this issue Nov 7, 2023 · 4 comments
Labels
[Block] Heading Affects the Headings Block Needs Design Feedback Needs general design feedback. [Package] Block editor /packages/block-editor [Type] Bug An existing feature does not function as intended

Comments

@jsnajdr
Copy link
Member

jsnajdr commented Nov 7, 2023

Steps to reproduce:

  1. Create a H2-level Heading block.
  2. Open the heading level dropdown in the block toolbar, with the intent to switch the heading to H3.
  3. As you move the mouse cursor towards the H3 option, it moves over the H2 option, triggering its "Heading 2" tooltip to display.
  4. As you move the mouse cursor further, onto the H3 option, you cannot click the H3 option because it is obscured by H2's tooltip. And because the mouse cursor is inside the tooltip, the tooltip is permanently displayed and doesn't disappear.
Screenshot 2023-11-07 at 13 02 29

A very minor bug, but I found the behavior very unpleasant when I encountered it.

@jsnajdr jsnajdr added [Type] Bug An existing feature does not function as intended [Block] Heading Affects the Headings Block [Package] Block editor /packages/block-editor labels Nov 7, 2023
@talldan
Copy link
Contributor

talldan commented Nov 7, 2023

It could be another case of #55815. (cc @afercia)

@afercia afercia added the Needs Design Feedback Needs general design feedback. label Nov 7, 2023
@afercia
Copy link
Contributor

afercia commented Nov 7, 2023

@talldan thanks for the ping.
I wouldn't say this is another case of #55815
These buttons accessible name is different from the visible text (which actually is an SVG icon). For example:

aria-label="Heading 2"

As such, the accessible name needs to be exposed visually as we do for all icon buttons.

Rather, in this case the problem is in the tooltip positioning.

  • The dropdown with the heading levels used to be horizontal.
  • It was changed to vertical.
  • The tooltip position was not adjusted for the new vertical dropdown orientation.

I can think of two options:

  1. Adjust the tooltip positioning: I'm not sure there are settings for that.
  2. Just use full text instead of abbreviations like H1, H2, etc.

In my opinion, the second option would also bring in better user experience. Now that the dropdown is vertical, there is no need to save horizontal space by using shorter visible text H1, H2, etc.
I'd suggest to consider to use full text 'Heading 1', 'Heading 2', etc. so that:

  • we can remove the SVG icon
  • we can remove the tooltip
  • we can remove the aria-label
  • the target size is bigger
  • cognitive load is reduced

Screenshot after quickly editing HeadingLevelDropdown. It would need some CSS adjustments to highlight the selected level:

Screenshot 2023-11-07 at 14 46 53

@t-hamano
Copy link
Contributor

t-hamano commented Nov 7, 2023

This issue has also been discussed in #50402.

Another option I would suggest is to display both the icon and the text, as mentioned in this comment. It may be a little redundant, but I think we can visually understand which level is selected without having to adjust CSS.

@afercia
Copy link
Contributor

afercia commented Nov 8, 2023

Hi @t-hamano, good point. I'd be in favor of using both the icon and visible text. Having both icon and visible text is not uncommon in many big applications around, and that pattern is used for good reasons. See also prior discussion on #46003

I'd be in favor of closing this issue in favor of #50402 and continue the conversation there, as this issue is basically a duplicate. Please do feel free to reopen if I'm missing something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Heading Affects the Headings Block Needs Design Feedback Needs general design feedback. [Package] Block editor /packages/block-editor [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants