[scheduler] Improve event popup interactions and toggle behavior#22538
[scheduler] Improve event popup interactions and toggle behavior#22538mustafajw07 wants to merge 17 commits into
Conversation
… and EventDialog components
…s-and-calendar Signed-off-by: Mustafa Jawadwala <mustafajw07@gmail.com>
…ingEventsPlugin and fix errors type
Deploy previewhttps://deploy-preview-22538--material-ui-x.netlify.app/ Bundle size
Check out the code infra dashboard for more information about this PR. |
| const dataId = (data as any)?.id; | ||
| const currentId = (currentData as any)?.id; | ||
| if (isOpen && dataId != null && dataId === currentId) { | ||
| onClose(); |
There was a problem hiding this comment.
Codex finding, recurring occurrences with the same event id cannot be switched in one click:
the toggle logic compares only
data.id. Premium recurring occurrences share the eventidand differ byoccurrence.key(eventId::dateKey), so clicking a different occurrence of the same recurring event closes the dialog instead of opening the clicked occurrence.
There was a problem hiding this comment.
I’ve updated the logic to account for recurring occurrences as well.
| * Sets the ID of the event currently open in the event dialog. | ||
| * Pass `null` to clear the open event. | ||
| */ | ||
| public setOpenEventId = (eventId: SchedulerEventId | null) => { |
There was a problem hiding this comment.
This seems to only change the store state but doesn't open the dialog?
There was a problem hiding this comment.
I’ve updated the implementation to ensure the dialog open state is handled correctly alongside the selected event state.
| if (!(node instanceof Element)) { | ||
| continue; | ||
| } | ||
| if (node.matches('[data-event-dialog-trigger]')) { |
There was a problem hiding this comment.
This seems a bit loose, not sure if it's a realistic scenario but if there are 2 schedulers on the page, clicking an event in scheduler B while scheduler A’s dialog is open will bypass A’s click-away close and can leave both dialogs open
…methods and update event dialog integration
…rativeRef initialization
|
@rita-codes / @mj12albert Thanks. |
|
Thanks for working on this!! Screen.Recording.2026-06-08.at.11.18.59.mov |
I've fixed the issue now. Clicking on an empty area of the calendar will close the popup without creating a new event. I verified the behavior in the preview and it is working as expected. |
|
Thanks for the work on this @mustafajw07! 🙏 I tested it and found a blocking issue, and digging into it made me question the overall approach for closing the popup. Let me walk through how I got there. The bugWhen you open the recurrence tab and pick an option from the frequency dropdown, the popup closes. Same thing happens with the resource/color Root causeThe popup now closes via a This isn't a one-off: it affects every portaled overlay inside the dialog. The Why I don't think narrow patches are the wayThe current close logic is opt-out: close on any click, unless it's inside the dialog, or an event trigger, or the scope dialog…. That list of exceptions can never be complete:
I looked into whether moving to base-ui's Proposed direction: opt-in dismissalInstead of "close on any outside click, minus a list of exceptions", close only on explicit, intended gestures (an allowlist), which are finite and we fully control:
Any field popup (custom or internal) floats at @flaviendelangle @noraleonte — before @mustafajw07 invests more here, could you confirm how you see this? The chain of reasoning was: recurrence dropdown closes the popup → it's a portal/ClickAwayListener issue, not isolated → base-ui's tree-aware dismiss doesn't cover custom fields either → so the close logic itself (the opt-out approach) is the wrong shape, and an opt-in allowlist of gestures driven by the calendar is more robust for an extensible form. Does that match how you'd want event-dialog dismissal to work, especially with custom fields in mind? A few smaller things I also noted, independent of the above:
|
|
Thanks for the detailed analysis. I agree this seems more like a dismissal-strategy question than an isolated bug. I'll wait for feedback from @flaviendelangle / @noraleonte on the proposed direction before making larger changes. |
Closes #21921
Changelog