Open smotched opened 2 years ago
Hi @smotched , there are two things here:
List
inside a Pager
isn't working in iOS
. For this, have you tried using .pagingPriority(.simultaneous)
? The scenario is tricky because there are two elements here expecting a drag.Btw, the keys do work because those are implemented differently, onMoveCommand
if I remember correctly.
Hey @fermoya , I think you meant macOS
but yeah even with .pagingPriority(.simultaneous)
it unfortunately doesn't work. Could it be a macOS 13
thing maybe? are you getting anything on your side with the basic example above?
sidenote: ScrollView works nicely as well.
@smotched I see what you mean. Not sure why but in iOS works fine. I'll investigate to solve it.
In any case, it seems to me you're more interested in the trackpad option. It doesn't seem there's SwifUI natively built-in option to listen to this kind of event, all I find follows this approach. I'm not interested in anything that's not native. One option would be to create a view that uses that approach and then moves Pager
when desired by using pageOffset
modifier
Thanks @fermoya we may have to file a feedback with Apple since like you said it works fine on iOS
. I don't see why it shouldn't work if it works with ScrollView
unless there's an underlying issue in how List
is implemented on mac that's breaking your implementation.
Nevertheless thanks for looking into it!
Describe the bug Lists inside the Pager can't be dragged, or two finger swiped on mac
To Reproduce Place a
List
inside a PagerExpected behavior
Additional context Surprisingly arrow keys work pretty nicely (currently the only way to change pages)