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

Overflow Menu has first option always highlighted #436

Closed
tbcross opened this issue Nov 14, 2017 · 14 comments
Closed

Overflow Menu has first option always highlighted #436

tbcross opened this issue Nov 14, 2017 · 14 comments

Comments

@tbcross
Copy link

tbcross commented Nov 14, 2017

Detailed description

I'm using the vanilla version of the Overflow Menu, and whenever I open the menu, the first item in the list is always highlighted, even when I hover over a different item (which results in both items behind highlighted).

image

Is this issue related to a specific component?
Yep. Overflow Menu

What did you expect to happen? What happened instead? What would you like to see changed?
I expected nothing to be highlighted initially (since my cursor was still on the kabob-circles). When I did hover over an item, getting ready to select it, I expected only that specific item to be highlighted, not that one and the top one.

What browser are you working in?
Chrome

What version of the Carbon Design System are you using?
7.23.3

What offering/product do you work on? Any pressing ship or release dates we should be aware of?

Steps to reproduce the issue

  1. Open an overflow menu
  2. Notice that the first item is permanently highlighted.
@asudoh
Copy link
Contributor

asudoh commented Nov 14, 2017

@tbcross IIUC what this issue is about - You can change the behavior by removing data-floating-menu-primary-focus attribute from the 1st menu item. In other words, the highlight of the 1st item indicates focus and the highlight moves when you hit tab. If a designer can quickly provide a differentiated focus style from hovering over, I can put it in. CC @tw15egan

@tw15egan
Copy link
Collaborator

@tay-aitken @aagonzales this brings up the question of whether we should have differing focus and hover styles. Any ideas?

@aagonzales
Copy link
Member

Oh interesting. I never realized the focus remains even if you move the cursor. Will the first item always be focused? And it only becomes un-focused if the user tabs or clicks another item? Just hovering doesn't change the focus?

Because I think have a focus and a hover at the same time will always cause a little bit of confusion to the user.

I think a quick fix would be to change the focus state to an underline.
image

@tbcross
Copy link
Author

tbcross commented Nov 15, 2017

if I remove data-floating-menu-primary-focus from the first menu option, then the whole overflow menu is focused and doesn't look good at all (but it does fix that the item isn't highlighted anymore):
image

@aagonzales
Copy link
Member

oh yeah that's not great which I guess is why we changed the focus to the first item.

Can we have to focus stay on the ... icon? (option 2) Or is that weird?
image

@tw15egan
Copy link
Collaborator

tw15egan commented Nov 15, 2017

Accessibility wise, focus will need to go to each menu item otherwise it will negatively affect screen-readers

@aagonzales
Copy link
Member

aagonzales commented Nov 15, 2017

I wasn't suggesting removing the focus for all items but where the first focus is. Theoretically so no menu item was focused on open and focus on items only appears when the user starts tabbing.

@tw15egan
Copy link
Collaborator

@aagonzales I like that solution

@asudoh
Copy link
Contributor

asudoh commented Nov 15, 2017

@aagonzales @tw15egan @tbcross Focus-on-first-item-on-open idea came from the limitation of overflow menu (floating menu); The location of DOM is so distinct that I see no way to tell browser that the next focus item to the trigger button is the overflow menu. The only way to get the focus stuff right is moving focus to overflow menu right when it opens.

One idea I’d have is designing the focus outline style for #436 (comment) condition. Browser’s default focus outline is not great there due to the nature of the pseudo element for triangle, but we can fix that by using custom outline style. Thoughts?

@alisonjoseph
Copy link
Member

It looks like we have two options here, either change the focus state for the options in the overflow menu to the underline that @aagonzales has as the first option here

or update the styling of default focus state with the data-floating-menu-primary-focusremoved

Which would you prefer @aagonzales?

@marijohannessen
Copy link
Contributor

@aagonzales do you have any input here?

@bsonefeld
Copy link
Contributor

Need more design input before FED can move forward.

@aagonzales
Copy link
Member

aagonzales commented May 4, 2018

I think we we should avoid having a focus and hover on different items at the same time would be best. Option 2 would be the ideal solution. But Option 1 is acceptable if option 2 is not possible.

joshblack pushed a commit to joshblack/carbon that referenced this issue May 2, 2019
…-design-system#436)

* chore(package.json): update to use latest bluemix-icons@4.0.6

* fix(copy-button): use updated icon

* copy--code icon is removed

* fix(CopyButton): update test to match new icon change

* chore(package.json): update bluemix-icons to 4.1.1
joshblack pushed a commit to joshblack/carbon that referenced this issue May 2, 2019
…design-system#436 (carbon-design-system#836)

* fix(NumberInput): handle case when input is invalid, resolves carbon-design-system#436

* fix(NumberInput): handle case when input is invalid, resolves carbon-design-system#436
@carmacleod
Copy link
Contributor

@aagonzales @alisonjoseph @marijohannessen
I realize that this issue was fixed (using Option 1), and closed a year ago, but just so you know, there is an "Option 3". :)

You could have focus follow hover within the popup.

Details and code example in #2259

joshblack added a commit to joshblack/carbon that referenced this issue May 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants