Skip to content
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

disableMonthEventCellPress not working with multiday event in month mode #1139

Open
ondrejvrabel opened this issue Feb 13, 2025 · 3 comments

Comments

@ondrejvrabel
Copy link

When using month mode and setting disableMonthEventCellPress to true, the event can be pressed in the other days, e.g. in the case the event starts on 2025-01-01 and ends on 2025-01-05, when tapping the event in the cell for 2025-01-01, the event onPressEvent is not fired (this is expected/desired behavior) and onPressCell is fired. However, when tapping the event in the cell for 2025-01-02, the event onPressEvent is fired (this is a bug) and onPressCell is not fired. This happens on iOS and on Android, too. I did not test it on web.

Image
@acro5piano
Copy link
Owner

@ondrejvrabel Thank you for filing this. Could you make a pull request for this? I'm happy merge it if you do. I think the event is fired on the event hander too.

Suspicious code:

const touchableOpacityProps = useCalendarTouchableOpacityProps({
event,
eventCellStyle,
eventCellAccessibilityProps,
onPressEvent,
injectedStyles: [
{ backgroundColor: theme.palette.primary.main },
isMultipleDaysStart && eventWeekDuration > 1
? {
position: 'absolute',
width: eventWidth,
zIndex: 10000,
}
: {},
isRTL ? { right: 0 } : { left: 0 },
],
})

@ondrejvrabel
Copy link
Author

I fixed it by adding this prop: eventCellAccessibilityProps={{pointerEvents: 'none'}}

@acro5piano
Copy link
Owner

@ondrejvrabel That is a nice catch - if you create a pull request for this, it would be helpful to everyone. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants