Skip to content

fix(web): fix #4574 link button + improves accessibility - #4575

Merged
jrasm91 merged 7 commits into
immich-app:mainfrom
BogdanCerovac:4574-link-button-fix
Oct 25, 2023
Merged

jrasm91 merged 7 commits into
immich-app:mainfrom
BogdanCerovac:4574-link-button-fix

Conversation

@BogdanCerovac

@BogdanCerovac BogdanCerovac commented Oct 21, 2023 •

Copy link
Copy Markdown
Contributor

Button in a link fixed,
horizontal rule is decorative here
and aria-current="page" informs screen-readers that user is on that page when focusing on the link.

fixes #4574

…page

Horizontal rule indicates current page for users that can see the screen and with aria-current screen-reader users get the same information
@vercel

vercel Bot commented Oct 21, 2023 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
immich ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2023 0:40am

@jrasm91

jrasm91 commented Oct 21, 2023

Copy link
Copy Markdown
Member

Can you add to the description before/after screenshots if applicable?

@jrasm91 jrasm91 changed the title Fixes #4574 link button + improves accessibility fix(web): fix #4574 link button + improves accessibility Oct 21, 2023
This is a temporary fix as we first need to fix the svelte-material-icons to support role="img" on rendered SVGs.
@BogdanCerovac

BogdanCerovac commented Oct 21, 2023 •

Copy link
Copy Markdown
Contributor Author

@jrasm91 - sure, please check them below.

I also had to make a temporary fix for accessibility name of the link with aria-label because it seems that svelte-material-icons don't have a prop to set proper role to it (should be role="img" (will make a PR there before we can have a permanent fix here)).

Screenshots before:

Desktop:
Desktop - button nested inside a link

Mobile:
Mobile - button nested inside a link, only icon shown

Screenshot after:

Desktop:
Desktop - link without button

Mobile:
Mobile - link without button, only icon shown

@BogdanCerovac

Copy link
Copy Markdown
Contributor Author

Opened issue for SVG missing role in ramiroaisen/svelte-material-icons#20

Comment thread web/src/lib/components/shared-components/navigation-bar/navigation-bar.svelte Outdated
BogdanCerovac and others added 2 commits October 25, 2023 10:05
hr is not semantically correct, therefore we tried with role="decoration" (that should be role="presentation") but it's actually better to just use a div as it's best practice to not override semantics when we can avoid that...

Btw. the semantics for active element for assistive technology is added with previous commit setting aria-current on the link...
@jrasm91
jrasm91 enabled auto-merge (squash) October 25, 2023 12:52
@jrasm91
jrasm91 merged commit d5e19e4 into immich-app:main Oct 25, 2023
@jrasm91

jrasm91 commented Nov 10, 2023

Copy link
Copy Markdown
Member

I justed wanted to follow up on this - we don't use svelte-material-icons anymore and our own Icon component should support the role attribute now, which defaults to role="img". Does that solve resolve the comment here

@BogdanCerovac

Copy link
Copy Markdown
Contributor Author

@jrasm91 - yes, thank you. role="img" is perfect for SVGs used as images.

Now we must make sure that icons that bear information or are used instead of text in interactive elements also have their accessibility name set (as discussed in ramiroaisen/svelte-material-icons#20 (comment)).

Will check and open an issue or PR...

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.

[BUG] Navigation item Administration, in header is a link that wrapps a button

2 participants