🐛 répare le comportement de l'autocomplète de commune au click

pull/1102/head
Johan Girod 2020-08-28 17:42:58 +02:00
parent 78e7adc7ae
commit 26c15baa2b
2 changed files with 11 additions and 1 deletions

View File

@ -150,8 +150,8 @@ export default function Select({ onChange, value }) {
<input
role="combobox"
type="search"
onBlur={submitFocusedElem}
aria-autocomplete="list"
onBlur={submitFocusedElem}
aria-readonly="true"
css={noResult ? 'border-color: firebrick !important' : ''}
className="ui__"
@ -186,9 +186,14 @@ export default function Select({ onChange, value }) {
const nom = formatCommune(result)
return (
<Option
onMouseDown={
// Prevent input blur and focus elem selection
e => e.preventDefault()
}
onClick={() => handleSubmit(result)}
role="option"
focused={i === focusedElem}
data-role="commune-option"
key={nom}
onFocus={() => setFocusedElem(i)}
>

View File

@ -7,6 +7,11 @@ type OverlayProps = React.HTMLAttributes<HTMLDivElement> & {
xPosition?: number
children: React.ReactNode
}
declare global {
interface Window {
parentIFrame?: any
}
}
const useIFrameOffset = () => {
const [offsetTop, setOffset] = useState<number | null>(null)