Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

Stop propagation of mousedown on modal

Luke Vella53906b1acf52
diff --git a/components/forms/poll-options-form/month-calendar/time-picker.tsx b/components/forms/poll-options-form/month-calendar/time-picker.tsx
index 274d528a5..ebe6d1bbe 100644
--- a/components/forms/poll-options-form/month-calendar/time-picker.tsx
+++ b/components/forms/poll-options-form/month-calendar/time-picker.tsx
@@ -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>,
diff --git a/components/modal/modal.tsx b/components/modal/modal.tsx
index d4e3a48c4..3ebd43b6a 100644
--- a/components/modal/modal.tsx
+++ b/components/modal/modal.tsx
@@ -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}