refactor: Change srLabel to label

This commit is contained in:
Aman Harwara
2021-10-04 20:22:19 +05:30
parent be047ebe65
commit f233c87b0f

View File

@@ -19,7 +19,7 @@ export type DropdownItem = {
type DropdownProps = { type DropdownProps = {
id: string; id: string;
srLabel: string; label: string;
items: DropdownItem[]; items: DropdownItem[];
defaultValue: string; defaultValue: string;
onChange: (value: string) => void; onChange: (value: string) => void;
@@ -58,7 +58,7 @@ const CustomDropdownButton: FunctionComponent<ListboxButtonProps> = ({
export const Dropdown: FunctionComponent<DropdownProps> = ({ export const Dropdown: FunctionComponent<DropdownProps> = ({
id, id,
srLabel, label,
items, items,
defaultValue, defaultValue,
onChange, onChange,
@@ -74,7 +74,7 @@ export const Dropdown: FunctionComponent<DropdownProps> = ({
return ( return (
<> <>
<VisuallyHidden id={labelId}>{srLabel}</VisuallyHidden> <VisuallyHidden id={labelId}>{label}</VisuallyHidden>
<ListboxInput <ListboxInput
value={value} value={value}
onChange={handleChange} onChange={handleChange}