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

fix: The navItems are not clickable with vimium (accessibility) #545

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

michaelfresco
Copy link

Motivation

  • This PR adds a tag role="checkbox" to the navItems. This has the benefit that keyboard users can use vimium to navigate the user interface. At the moment, the navItems do not show up as links, because they do not contain a typical <a href>

  • Adding role="checkbox" works around that issue, and makes them clickable

  • Please also see the original issue: The navItems are not clickable with vimium (accessibility) argo-workflows#12813

@michaelfresco michaelfresco changed the title fix: The navItems are not clickable with vimium (accessibility) (#12813) fix: The navItems are not clickable with vimium (accessibility) Mar 17, 2024
@@ -36,7 +36,7 @@ export const NavBar: React.FunctionComponent<NavBarProps> = (props: NavBarProps,
{(props.items || []).map((item) => (
<Tooltip content={item.title} placement='right' arrow={true} key={item.path + item.title}>
<div className={classNames('nav-bar__item', { active: isActiveRoute(locationPath, item.path) })}
onClick={() => context.router.history.push(item.path)}>
onClick={() => context.router.history.push(item.path)} role="checkbox">
Copy link
Contributor

Choose a reason for hiding this comment

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

  • At the moment, the navItems do not show up as links, because they do not contain a typical <a href>

why not use an actual <Link> component here? Same as #222 (comment), that would resolve #166 as well

Copy link
Author

Choose a reason for hiding this comment

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

I tried a few variations with a <Link> component but I don't know how to make this work. (I have little experience with web development). However, I think that it is a Tooltip-thing. If you look at other Tooltip examples, they have the same issue. Like here, https://react-tooltip.com/docs/getting-started, the Tooltip buttons are clickable but do not show up as real links.

tool-tip-demo

@agilgur5 agilgur5 self-assigned this May 12, 2024
@tooptoop4
Copy link

where @michaelfresco

@michaelfresco
Copy link
Author

michaelfresco commented Nov 5, 2024

Hi @tooptoop4, and @agilgur5,

A link like this also works:

                    <Tooltip content={item.title} placement='right' arrow={true} key={item.path + item.title}>
                    <a href="#">
                        <div className={classNames('nav-bar__item', { active: isActiveRoute(locationPath, item.path) })}
                            onClick={() => context.router.history.push(item.path)}>
                            <i className={item.iconClassName}/>
                        </div>
                    </a>
                    </Tooltip>

screen

(I verified this with a locally built Argo Workflows image)

Signed-off-by: Michael Fresco <15065392+michaelfresco@users.noreply.github.com>
@tooptoop4
Copy link

@crenshaw-dev 📦 pls

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

Successfully merging this pull request may close these issues.

3 participants