🐛 Fix: Runtime error when dragging all-day draft#289
Merged
tyler-dane merged 7 commits intomainfrom Mar 9, 2025
Merged
Conversation
1 task
2561915 to
d7793ef
Compare
if mousing up before threshold: click if mouse is still down after threshold: drag if mouse down + move before threshold: drag
- Update event form to stop event propagation on mouse events - Add `type="button"` to delete buttons to prevent form submission - Modify calendar test to use `document.body` for closing form - Simplify event form mouse interaction logic
Remove commented-out test assertion to improve test coverage and clarity
9642633 to
b5b87c4
Compare
c2702c1 to
6229f57
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #286
After
works.mov
This pull request includes several changes to the calendar event handling and testing in the
packages/webdirectory. The most important changes involve refactoring the event mouse handling logic to differentiate between click and drag actions, updating related components, and adding new tests to ensure the functionality works as expected.Event Mouse Handling Refactor:
useGridEventMouseDownhook to differentiate between click and drag actions based on mouse behavior.useGridEventMouseHoldhook.packages/web/src/views/Calendar/hooks/grid/useGridEventMouseDown.test.ts: Added new tests for theuseGridEventMouseDownhook to verify its behavior for different mouse actions and scenarios.Test File Changes:
packages/web/src/views/Calendar/Calendar.form.test.tsx: Removed commented-out tests and unnecessary helper functions, and made minor adjustments to existing tests. [1] [2] [3]Additional Changes:
packages/web/src/views/Calendar/components/Draft/hooks/effects/useDraftEffects.ts: Adjusted logic to ensure that the draft state is correctly managed during dragging and resizing events. [1] [2]packages/web/src/views/Calendar/hooks/grid/useDragEventSmartScroll.ts: Added condition to handle all-day events during drag operations.