Skip to content

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

Fix cannot edit times in week view

Luke Vella5f563c6423ca
diff --git a/components/dropdown.tsx b/components/dropdown.tsx
index 1c18a2450..3478ee168 100644
--- a/components/dropdown.tsx
+++ b/components/dropdown.tsx
@@ -4,6 +4,7 @@ import clsx from "clsx";
import * as React from "react";
import ReactDOM from "react-dom";
import { usePopper } from "react-popper";
+import { stopPropagation } from "utils/stop-propagation";
export interface DropdownProps {
trigger?: React.ReactNode;
@@ -53,6 +54,7 @@ const Dropdown: React.VoidFunctionComponent<DropdownProps> = ({
style={styles.popper}
{...attributes.popper}
className="z-30 divide-gray-100 rounded-md bg-white p-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"
+ onMouseDown={stopPropagation}
>
{children}
</Menu.Items>,
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 29d91df0d..4ad55fcba 100644
--- a/components/forms/poll-options-form/month-calendar/time-picker.tsx
+++ b/components/forms/poll-options-form/month-calendar/time-picker.tsx
@@ -4,6 +4,7 @@ import { addMinutes, format, isSameDay, setHours, setMinutes } from "date-fns";
import * as React from "react";
import ReactDOM from "react-dom";
import { usePopper } from "react-popper";
+import { stopPropagation } from "utils/stop-propagation";
import ChevronDown from "../../../icons/chevron-down.svg";
import { styleMenuItem } from "../../../menu-styles";
@@ -94,6 +95,7 @@ const TimePicker: React.VoidFunctionComponent<TimePickerProps> = ({
{...attributes.popper}
ref={setPopperElement}
className="z-50 max-h-72 w-32 overflow-auto rounded-md bg-white py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"
+ onMouseDown={stopPropagation}
>
{options}
</Combobox.Options>,
diff --git a/components/modal/modal.tsx b/components/modal/modal.tsx
index e91d2100a..ee791d10f 100644
--- a/components/modal/modal.tsx
+++ b/components/modal/modal.tsx
@@ -61,9 +61,6 @@ const Modal: React.VoidFunctionComponent<ModalProps> = ({
animate={{ opacity: 1, scale: 1 }}
exit={{ opacity: 0, scale: 0.9 }}
className="z-50 my-8 mx-4 inline-block w-fit transform overflow-hidden rounded-xl bg-white text-left align-middle shadow-xl transition-all"
- onMouseDown={(e) => {
- e.stopPropagation();
- }}
>
{content ?? (
<div className="max-w-lg p-4">
diff --git a/utils/stop-propagation.ts b/utils/stop-propagation.ts
new file mode 100644
index 000000000..8a10f6277
--- /dev/null
+++ b/utils/stop-propagation.ts
@@ -0,0 +1,3 @@
+import React from "react";
+
+export const stopPropagation = (e: React.MouseEvent) => e.stopPropagation();