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

feat(switcher): automate max height, closes on bg click, update disabled tab index #870

Merged
merged 23 commits into from
Jun 16, 2020

Conversation

jnm2377
Copy link
Contributor

@jnm2377 jnm2377 commented Jun 3, 2020

Closes #840
Closes #856

As well as fixes a bug I found:
Screen Shot 2020-06-03 at 2 46 15 PM

Changed

  • Closes switcher if you click elsewhere on the page (previously, this only happened on mobile, lg breakpoints only closed via the close button)
  • Automates max-height styles
  • Updates tabindex so that switcher items aren't focusable if they are disabled

@jnm2377 jnm2377 requested review from a team, vpicone and andreancardona and removed request for a team June 3, 2020 22:06
@vercel
Copy link

vercel bot commented Jun 3, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/carbon-design-system/gatsby-theme-carbon/lbhxqp4uk
✅ Preview: https://gatsby-theme-carbon-git-fork-jnm2377-update-switcher.carbon-design-system.vercel.app

@vercel vercel bot temporarily deployed to Preview June 3, 2020 22:06 Inactive
Copy link
Contributor

@andreancardona andreancardona left a comment

Choose a reason for hiding this comment

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

the build is failing :(

Copy link
Contributor

@vpicone vpicone left a comment

Choose a reason for hiding this comment

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

Lookin good just some minor stuff

Copy link
Contributor

@andreancardona andreancardona left a comment

Choose a reason for hiding this comment

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

lgtm! :) @jnm2377

@vpicone
Copy link
Contributor

vpicone commented Jun 12, 2020

@jnm2377 the disabled thing is actually intended. You want disabled form elements to be tabbable. Otherwise users navigating by keyboard won't know they exist at all, which is a different thing than the "exists but isn't selectable" info that sited users get from a disabled element.

@jnm2377
Copy link
Contributor Author

jnm2377 commented Jun 15, 2020

@vpicone we don't do that in any of our carbon components. For example if a button is disabled, we it's not tabbable. How does that make sense here?

@vpicone
Copy link
Contributor

vpicone commented Jun 16, 2020

@jnm2377 I think you're right just because they're disabled doesn't mean they're invisible to screen readers. Not sure if there's any screen reader hints that the link is disabled or if it'd show up as normal text. But either way I think taking them out of the tab order is the right move here.

@jnm2377
Copy link
Contributor Author

jnm2377 commented Jun 16, 2020

@jnm2377 I think you're right just because they're disabled doesn't mean they're invisible to screen readers. Not sure if there's any screen reader hints that the link is disabled or if it'd show up as normal text. But either way I think taking them out of the tab order is the right move here.

@dakahn just want to confirm this is ok to do. We currently have a disabled item in the switcher and it's still tabbable. In this PR, I updated switcher items to not be tabbable if they're disabled. Is that ok? It seems like that's the pattern we do for everything else that's disabled.

@vpicone
Copy link
Contributor

vpicone commented Jun 16, 2020

@jnm2377 yup, I'm on board with your change.

It's weird because there is no 'disabled' attribute for native links on the web (like there is for buttons or other for inputs), so its sort of a weird gray area but I think sticking to the Carbon Link component behavior is the right move for sure.

@jnm2377
Copy link
Contributor Author

jnm2377 commented Jun 16, 2020

@vpicone looks like the changes are working correctly 🎉

@jnm2377 jnm2377 requested a review from vpicone June 16, 2020 19:34
@vercel vercel bot temporarily deployed to Preview June 16, 2020 19:52 Inactive
@vpicone
Copy link
Contributor

vpicone commented Jun 16, 2020

🚀

@jnm2377 jnm2377 merged commit 5f3dcb5 into carbon-design-system:master Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants