twinssbc / Ionic2-Calendar

A calendar component based on Ionic framework
https://ionic-calendar-demo.stackblitz.io
MIT License
388 stars 197 forks source link

onTimeSelected(ev) problem #194

Open ChrisK1994 opened 7 years ago

ChrisK1994 commented 7 years ago

It seems like it doesn't really select the time you click on but it selects the starting time of an event you click if there is any, how to fix that?

twinssbc commented 7 years ago

@Astacius You mean in the weekview and dayview? The root cause is because the event element is floating on the calendar table. Once you click it, the event element (which starts from the startTime cell) is handling the click event, instead of the real underlying timeslot. If you click a cell that is not overlapped by an event, the time should be correct. I'm still thinking a way to handle the first case, maybe using the cursor pointer to do the calculation.

paean99 commented 6 years ago

Simply using CSS by adding 'pointer-events: none;' to the classes 'calendar-event-wrap' or 'calendar-event' could help for the beginning of a temporary solution (at least for the browser platform). The child elements pointer-events can also be controlled individually. But i suggest that it should be an togglable option. Probably a better alternative would be to change the design?

More here: developer.mozilla.org or in much more details www.w3.org

Titoch commented 6 years ago

I encounter the same issue. Maybe is it possible to left some empty space on one side of the events? It would permit user to select the event or the empty zone.

This solution seems to be only possible modifying the inline width of calendar-event? 1 event --> width : 50% (50% empty) 2 events --> width : 66% (33% empty) and so on. Is it possible?