-
Notifications
You must be signed in to change notification settings - Fork 2
Fix slot selecting issue on mobile #154
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
Changes from 1 commit
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -27,7 +27,8 @@ | |||||
| } | ||||||
|
|
||||||
| :global(.rbc-month-view .rbc-date-cell) { | ||||||
| padding: 0; | ||||||
| min-height: 50px; /* Adjust height based on your design */ | ||||||
| padding-bottom: 10px; /* Ensures space below existing events is clickable */ | ||||||
| } | ||||||
|
|
||||||
| :global(.rbc-month-view .rbc-date-cell .rbc-button-link) { | ||||||
|
|
@@ -36,4 +37,6 @@ | |||||
| height: 100%; | ||||||
| padding: 0.25rem 0.5rem; | ||||||
| text-align: left; | ||||||
| padding-bottom: 150px; | ||||||
|
||||||
| padding-bottom: 150px; | |
| padding-bottom: 10px; /* Provide extra clickable space without distorting layout */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,12 +51,20 @@ type Props = Omit<CalendarProps<CalendarBooking>, "localizer"> & | |
| }>; | ||
|
|
||
| function BookingCalendar(props: Props) { | ||
| const { onRepeatSlot } = props; | ||
| const { onRepeatSlot, onSelectSlot, longPressThreshold, ...calendarProps } = | ||
| props; | ||
|
|
||
| const handleSelectSlot = (slotInfo: any) => { | ||
|
||
| if (onSelectSlot) { | ||
| onSelectSlot(slotInfo); | ||
| } | ||
| }; | ||
| return ( | ||
| <div className={styles.calendarWrapper}> | ||
| <Calendar | ||
| localizer={dateLocalizer} | ||
| selectable={true} | ||
| longPressThreshold={longPressThreshold ?? 50} | ||
| toolbar | ||
| titleAccessor="title" | ||
| startAccessor="start" | ||
|
|
@@ -82,7 +90,8 @@ function BookingCalendar(props: Props) { | |
| dayPropGetter={dayPropGetter} | ||
| slotPropGetter={slotPropGetter} | ||
| eventPropGetter={eventPropGetter} | ||
| {...props} | ||
| onSelectSlot={handleSelectSlot} | ||
| {...calendarProps} | ||
|
||
| /> | ||
| </div> | ||
| ); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -223,6 +223,7 @@ function BookingCreationTimeSlotSelector() { | |
| onDrillDown={onDrillDown} | ||
| onRepeatSlot={onRepeatSlot} | ||
| selectable | ||
| longPressThreshold={50} | ||
|
||
| /> | ||
| </Segment> | ||
|
|
||
|
|
||
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.
Removing
padding: 0and replacing it withpadding-bottom: 10pxwill also add default padding to other sides of the element. If the intent was to only have bottom padding, consider usingpadding: 0 0 10px 0to be more explicit and avoid unintended padding on other sides.