Skip to content

Commit

Permalink
expose role variable so its possible to change it
Browse files Browse the repository at this point in the history
  • Loading branch information
vilderoxan committed Jan 25, 2024
1 parent 2b23f6a commit 676e95d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion @navikt/core/react/src/form/search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export interface SearchProps
* Exposes the HTML size attribute
*/
htmlSize?: number | string;
/*
* Exposes role attribute
*/
role?: string
}

interface SearchComponent
Expand Down Expand Up @@ -114,6 +118,7 @@ export const Search = forwardRef<HTMLInputElement, SearchProps>(
onChange,
onSearchClick,
htmlSize,
role,
...rest
} = props;

Expand Down Expand Up @@ -205,7 +210,7 @@ export const Search = forwardRef<HTMLInputElement, SearchProps>(
value={value ?? internalValue}
onChange={(e) => handleChange(e.target.value)}
type="search"
role="searchbox"
role={role ?? 'searchbox'}
className={cl(
className,
"navds-search__input",
Expand Down

0 comments on commit 676e95d

Please sign in to comment.