HorizonCalendar icon indicating copy to clipboard operation
HorizonCalendar copied to clipboard

Request: Disable User Interaction For Scrolling

Open zachterrell57 opened this issue 4 years ago • 8 comments

Hello everyone,

This calendar is still great, really loving the ease of use that comes with it! One request that I have for a specific use case is to disable user-interaction for scrolling. In this scenario, the only way to scroll the calendar would be via button press. Would it be possible to implement the option to disable this scrolling behavior? I should add that my calendar is oriented in the horizontal position.

Thanks!

zachterrell57 avatar Dec 28 '20 23:12 zachterrell57

Hey Zach,

Thinking through the API a bit: I think we'll want to make this a configurable property on CalendarViewContent. I'm wondering if this option makes sense for vertical and horizontal calendars, or if the UX really only makes sense for horizontal calendars. It seems really non-standard to have a vertical-layout calendar that can't be scrolled with a finger (and would instead rely on up / down arrows to manually paginate). I see the use-case for horizontal calendars, though. What do you think?

bryankeller avatar Dec 30 '20 20:12 bryankeller

@bryankeller I do think this is more for a use-case for horizontal calendars (and could tie neatly into the work you're doing for pagination vs free scrolling) if I can chime in!

saudeon avatar Dec 30 '20 21:12 saudeon

I agree with both of you, I think this is a feature mainly for horizontally-scrolling calendars. I do think the combination of this behavior plus the pagination feature would unlock a ton of additional use cases, as @saudeon mentioned.

The provided mockup is the only use-case I could see the vertical pagination being useful for. An additional one that I didn't create would be if there was a calendar embedded in something like a UICollectionView, where the act of vertically scrolling was already being used. However, I can't imagine a real world scenario in which someone does this.

image

zachterrell57 avatar Dec 30 '20 21:12 zachterrell57

Nice, thanks for the example @zachterrell57. I definitely see how this could apply to vertically-scrolling calendars, but I find that UX to be particularly non-standard for a native iOS app, so I'm leaning toward not allowing it to discourage people from doing the wrong thing 😝

Edit: Just saw your example of it being embedded in a vertically-scrolling collection view cell - in this case, I think the correct UX would be to have a horizontally-scrolling calendar embedded in the cell.

bryankeller avatar Dec 31 '20 04:12 bryankeller

@bryankeller

Totally agree. I was kinda of grasping at straws to find a vertical use case 😆. So would you only allow this behavior in the .horizontal mode then?

zachterrell57 avatar Dec 31 '20 04:12 zachterrell57

Yes, I think this should only be a feature of the horizontal-use-case. As a temporary workaround, you can disable scrolling on calendarView.subviews[0], and implement your button press functionality by calling scrollToMonth. I don't have near-term plans to start work on this as part of the API, but hopefully this hacky workaround can unblock you.

bryankeller avatar Mar 06 '21 20:03 bryankeller

Yes, I think this should only be a feature of the horizontal-use-case. As a temporary workaround, you can disable scrolling on calendarView.subviews[0], and implement your button press functionality by calling scrollToMonth. I don't have near-term plans to start work on this as part of the API, but hopefully this hacky workaround can unblock you.

@bryankeller, I'm quite bit lost but how can we disable the scrolling of horizontal calendar using calendarView.subviews[0] that you mentioned?

jl-mobitech avatar Dec 20 '23 12:12 jl-mobitech

Is there any workaround or estimate on when this will be available for SwiftUI implementation?

jonathansds avatar Aug 13 '24 13:08 jonathansds