Repository navigation
fix(calendar): drag compact month chips instead of selecting days (#2641) - #2642
Merged
Merged
Conversation
…clicked (#2641) At calendar widths up to 850px Month draws tasks as chips. The chips ignored the pointer, so pressing one reached the day cell and a drag became a date selection that opened the create menu. Without the selected-day panel the chips now take the pointer, so the calendar moves, opens or shows the menu for the task as in the wider layout.
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.
Fixes #2641.
Cause. When the calendar is 850px wide or narrower, Month uses the compact
chipsdisplay. Chips are indicator items withpointer-events: none, so a press on a task chip reached the day cell, the calendar started a date selection, and releasing opened the create menu. Week view and wider Month views draw normal items, so they were unaffected. Google Calendar and the reporter'scalendarViewoptions aren't involved: the calendar width alone triggers it, e.g. with a sidebar open.Fix. CSS only (
styles/bases-calendar.css): when the selected-day panel is off, chips take the pointer. The calendar library already handles moving indicator items, so chips can now be dragged, clicked to open the task and right-clicked for the task menu. With Show selected day panel on, chips keep ignoring the pointer, so pressing one still selects its day.Tests.
e2e/issues/issue-2641-month-view-drag.spec.tsdrags an all-day and a timed task one day in Month at a chip-layout width. It fails without the fix (a date selection starts) and passes with it. I also checked click (opens the task) and right-click (shows the menu) by hand in the isolated e2e vault.npm run lintandscripts/calendar-css.test.mjspass.No overlap with #2633: that PR doesn't touch
styles/bases-calendar.css.