Skip to content

Commit

Permalink
Tag 2215 a11y fixes (#128)
Browse files Browse the repository at this point in the history
* fiks manglende id på dropdown referert til via aria-controls

* bump patch version
  • Loading branch information
kenglxn authored Nov 27, 2023
1 parent 241a70b commit ae5a3ce
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@navikt/bedriftsmeny",
"version": "6.12.0",
"version": "6.12.1",
"description": "Bedriftsvelger og -meny for innlogget arbeidsgiver. Laget av TAG (Tjenester for Arbeidsgivere).",
"author": "NAVIKT",
"license": "MIT",
Expand Down
5 changes: 3 additions & 2 deletions src/bedriftsmeny/velger/Dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import React from "react";

interface Props {
interface Props extends React.HTMLAttributes<HTMLDivElement> {
children: React.ReactNode,
ariaLabel: string,
friKomponent: boolean,
erApen: boolean,
}

const Dropdown = ({erApen, ariaLabel, friKomponent, children}: Props) => {
const Dropdown = ({erApen, ariaLabel, friKomponent, children, ...divProperties}: Props) => {
return erApen ? <div
role='dialog'
aria-label={ariaLabel}
className={`Dropdown-panel ${!friKomponent ? "Dropdown-panel-Bedriftsmeny" : ""}`}
{...divProperties}
>
{children}
</div> : null
Expand Down
1 change: 1 addition & 0 deletions src/bedriftsmeny/velger/Virksomhetsvelger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ const Velger = ({friKomponent} : {friKomponent: boolean} ) => {
</div>
</Button>
<Dropdown
id="navbm-virksomhetsvelger-popup"
ariaLabel="Virksomhetsvelger"
friKomponent={friKomponent}
erApen={åpen}
Expand Down

0 comments on commit ae5a3ce

Please sign in to comment.