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(a11y): enhance navigation and fix ds nav mobile focus #1151

Merged
merged 7 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions src/components/nav-sidebar/nav-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ function NavSidebar({
ariaLabel: " (Link esterno)",
};

// XXX We are currently using and repurposing the "navscroll" component of BSI, there may be some improvements to be made in a11y

if (list) {
links = list.map((item, index) => {
expandSublinks = false;

linksStyle =
"list-item text-uppercase right-icon" +
"list-item text-uppercase right-icon nav-link dropdown" +
Fupete marked this conversation as resolved.
Show resolved Hide resolved
`${item.label === page ? " active" : ""}` +
`${item.disabled ? " disabled" : ""}`;

Expand All @@ -61,10 +63,10 @@ function NavSidebar({
linksStyle += " contains-active";
}

let subLiStyle;
let subLiStyle = "nav-link";

if (subItem.disabled) {
subLiStyle = "disabled";
subLiStyle += "disabled";
}

return (
Expand Down Expand Up @@ -182,7 +184,7 @@ function NavSidebar({
>
<div className="nav-sidebar">
<nav
className="navbar it-navscroll-wrapper navbar-expand-lg it-bottom-navscroll it-right-side border-end-0"
className="navbar it-navscroll-wrapper navbar-expand-lg it-bottom-navscroll it-right-side border-end-0 megamenu"
Fupete marked this conversation as resolved.
Show resolved Hide resolved
aria-label={ariaLabel}
>
<button
Expand All @@ -200,16 +202,11 @@ function NavSidebar({
</button>
<div className="navbar-collapsable" id={id} ref={navCollRef}>
<div className="overlay" />
<div className="close-div visually-hidden">
<button className="btn close-menu" type="button">
<span className="it-close" />
{buttonCloseAriaLabel}
</button>
</div>
<div className="menu-wrapper">
<button
className="it-back-button btn w-100 text-start"
className="it-back-button btn w-100 text-start rounded-0"
type="button"
aria-label={buttonCloseAriaLabel}
>
<svg role="img" className="icon icon-sm icon-primary align-top">
<use href="/svg/sprites.svg#it-chevron-left" />
Expand Down
4 changes: 2 additions & 2 deletions src/data/dsnav.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ img: /images/design-system-menu.svg
alt: ""
ariaLabel: Menu design system
toggleLabel: Menu design system
toggleAriaLabel: Apri/Chiudi menu navigazione design System
toggleAriaLabel: Apri Menu design system
backLabel: Chiudi
buttonCloseAriaLabel: Chiudi navigazione
buttonCloseAriaLabel: Chiudi Menu design system
tag:
label: v1.0.0-alpha.15
addonClasses: bg-primary mt-2 text-white text-decoration-underline
Expand Down
2 changes: 1 addition & 1 deletion src/data/header.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ navbar:
theme: theme-dark-desk
ariaLabel: Menu principale
toggler:
ariaLabel: Mostra o nascondi il menu
ariaLabel: Apri il menu
close:
ariaLabel: Chiudi il menu
nav:
Expand Down
2 changes: 1 addition & 1 deletion src/data/skiplinks.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
skiplinks:
- label: Vai al menu
url: "#menuA" # xxx TO DEVELOP EXCEPTION FOR DESIGN SYSTEM PAGES... WE NEED A SECOND MENU LINK!
url: "#menuA" # xxx this approach is ok on desktop, doesn't work on mobile
- label: Vai al contenuto
url: "#main"
- label: Questa pagina è stata utile?
Expand Down
Loading