Merge pull request #24965 from overleaf/td-downshift-9-upgrade

Upgrade Downshift to version 9

GitOrigin-RevId: b36904ab0c82c09a633a25cd6fed651d7c8b19f7
This commit is contained in:
Tim Down
2025-04-24 08:06:24 +00:00
committed by Copybot
parent 8ec9cd21b4
commit fb50d429b4
11 changed files with 127 additions and 111 deletions
@@ -24,10 +24,8 @@ function Downshift({ setValue, inputRef }: CountryInputProps) {
getLabelProps,
getMenuProps,
getInputProps,
getComboboxProps,
getItemProps,
highlightedIndex,
openMenu,
selectedItem,
} = useCombobox({
inputValue,
@@ -50,7 +48,7 @@ function Downshift({ setValue, inputRef }: CountryInputProps) {
return (
<div className={classnames('dropdown', 'd-block')}>
<div {...getComboboxProps()}>
<div>
{/* eslint-disable-next-line jsx-a11y/label-has-for */}
<label {...getLabelProps()} className="visually-hidden">
{t('country')}
@@ -60,11 +58,6 @@ function Downshift({ setValue, inputRef }: CountryInputProps) {
onChange: (event: React.ChangeEvent<HTMLInputElement>) => {
setInputValue(event.target.value)
},
onFocus: () => {
if (!isOpen) {
openMenu()
}
},
ref: inputRef,
})}
placeholder={t('country')}
@@ -47,10 +47,8 @@ function Downshift({
getLabelProps,
getMenuProps,
getInputProps,
getComboboxProps,
getItemProps,
highlightedIndex,
openMenu,
selectedItem,
} = useCombobox({
inputValue,
@@ -82,8 +80,7 @@ function Downshift({
return (
<div className={classnames('dropdown', 'd-block')}>
<div {...getComboboxProps()}>
{/* eslint-disable-next-line jsx-a11y/label-has-for */}
<div>
<OLFormLabel
{...getLabelProps()}
className={showLabel ? '' : 'visually-hidden'}
@@ -95,11 +92,6 @@ function Downshift({
onChange: (event: React.ChangeEvent<HTMLInputElement>) => {
setValue(event.target.value)
},
onFocus: () => {
if (!isOpen) {
openMenu()
}
},
ref: inputRef,
})}
placeholder={placeholder}