Skip to content

Commit 48a8ebe

Browse files
fix: only title/time area of event card was clickable
The onClick handler was on .dragContent, which only wraps the title, time and location text. The rest of the card (padding, empty space below the text, and the area around the resize handle) had no click handler, so clicks in those areas did nothing — only the title/time text was clickable. Move onClick to the outer .card div so the entire card area is clickable. handleClick already suppresses the click when an actual resize or drag occurred, so this doesn't interfere with those interactions. Drag listeners stay on .dragContent so dragging still initiates from the content area only.
1 parent 2629cab commit 48a8ebe

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/features/calendar/components/EventCard.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ export const EventCard = React.memo(function EventCard({
267267
{...(isFragmentLast ? { 'data-fragment-last': '' } : {})}
268268
className={`${styles.card} ${compact ? styles.compact : ''} ${isCurrentDragging || isDragging ? styles.dragging : ''} ${isResizing ? styles.resizing : ''} ${hideTopRadius ? styles.noTopRadius : ''} ${isTask ? styles.task : ''} ${event.completed ? styles.completed : ''} ${event.completed ? styles.isDone : ''} ${isMobileMonth ? styles.mobileMonth : ''} ${monthView ? styles.monthView : ''} ${transparent ? styles.transparent : ''} ${isMultiDay ? styles.multiDay : ''} ${isFragmentMiddle ? styles.fragmentMiddle : ''} ${isFragmentFirst ? styles.fragmentFirst : ''} ${isFragmentLast ? styles.fragmentLast : ''} ${dotMode ? styles.dot : ''}`}
269269
onContextMenu={handleContextMenu}
270+
onClick={handleClick}
270271
{...bind}
271272
>
272273
{event.syncStatus === 'failed' && (
@@ -306,7 +307,6 @@ export const EventCard = React.memo(function EventCard({
306307
{isTask ? (
307308
<div
308309
className={styles.dragContent}
309-
onClick={handleClick}
310310
onPointerDown={(e) => {
311311
e.stopPropagation()
312312
pointerStartPos.current = { x: e.clientX, y: e.clientY }
@@ -330,7 +330,6 @@ export const EventCard = React.memo(function EventCard({
330330
<>
331331
<div
332332
className={styles.dragContent}
333-
onClick={handleClick}
334333
onPointerDown={(e) => {
335334
e.stopPropagation()
336335
pointerStartPos.current = { x: e.clientX, y: e.clientY }

0 commit comments

Comments
 (0)