-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[scheduler] Improve event popup interactions and toggle behavior #22538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 5 commits
de44e80
8774b84
eaf622f
b0c4149
517b0f3
689dfc8
3457d1a
15dd7be
31c1086
a4ce114
fd651ff
6972f29
df990f1
f4cb40b
cb15dc0
2d28094
3e61437
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,13 +86,19 @@ export function createModal<TData>(config: CreateModalConfig) { | |
| ref: React.ForwardedRef<HTMLElement | null>, | ||
| ) { | ||
| const { data, onClick, children } = props; | ||
| const { onOpen } = useModalContext(); | ||
| const { onOpen, onClose, isOpen, data: currentData } = useModalContext(); | ||
|
|
||
| return React.cloneElement(children as React.ReactElement<any>, { | ||
| ref, | ||
| onClick: (event: React.MouseEvent) => { | ||
| onClick?.(event); | ||
| onOpen(ref as React.RefObject<HTMLElement | null>, data); | ||
| const dataId = (data as any)?.id; | ||
| const currentId = (currentData as any)?.id; | ||
| if (isOpen && dataId != null && dataId === currentId) { | ||
| onClose(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codex finding, recurring occurrences with the same event id cannot be switched in one click:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’ve updated the logic to account for recurring occurrences as well. |
||
| } else { | ||
| onOpen(ref as React.RefObject<HTMLElement | null>, data); | ||
| } | ||
| }, | ||
| }); | ||
| }); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to only change the store state but doesn't open the dialog?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve updated the implementation to ensure the dialog open state is handled correctly alongside the selected event state.