Stop propagation of mousedown on modal

This commit is contained in:
Luke Vella 2022-04-15 18:26:55 +01:00
parent 654c300430
commit 53906b1acf
2 changed files with 6 additions and 4 deletions

View file

@ -54,9 +54,6 @@ const TimePicker: React.VoidFunctionComponent<TimePickerProps> = ({
key={i}
className={styleMenuItem}
value={optionValue.toISOString()}
onMouseDown={(e: React.MouseEvent<HTMLLIElement>) =>
e.stopPropagation()
}
>
{format(optionValue, "p")}
</Combobox.Option>,

View file

@ -61,7 +61,12 @@ const Modal: React.VoidFunctionComponent<ModalProps> = ({
leaveFrom="opacity-100 scale-100"
leaveTo="opacity-0 scale-95"
>
<div className="inline-block w-fit my-8 mx-4 overflow-hidden text-left align-middle transition-all transform bg-white shadow-xl rounded-xl">
<div
className="inline-block w-fit my-8 mx-4 overflow-hidden text-left align-middle transition-all transform bg-white shadow-xl rounded-xl"
onMouseDown={(e) => {
e.stopPropagation();
}}
>
{content ?? (
<div className="p-4 max-w-lg">
{title ? <Dialog.Title>{title}</Dialog.Title> : null}