buh / CompactSlider

CompactSlider is a SwiftUI control for macOS, iOS and watchOS.
MIT License
395 stars 25 forks source link

Turn off tap to position on slider #4

Closed doodahdayz closed 1 year ago

doodahdayz commented 1 year ago

Describe the bug If you are using this slider control and you tap anywhere on the slider the control will go to that position and respond with the new value. However, if you have this control in a window with other sliders in Grid or List view and are scrolling then this is not the behavior you need.
To Reproduce Steps to reproduce the behavior:

Expected behavior this is a nice feature.. sometimes... we need more control and have the ability to turn that off.

Also, it would be nice if there was a way to always show indicator marks.

Platform and version:

buh commented 1 year ago

Hey Thanks for reporting the issue. This is interesting case. Could you maybe provide my a screenshot or a code with layout to let me try to test and fix?

doodahdayz commented 1 year ago

Alexey, I don’t have anything to show you… I had to abandon trying to use it on iOS. It’s fine on watchOS where there is only one slider on the watch and you there is no scrolling.

What you need to do is provide a way to set something like “no touches” for selecting a spot on the slider so then it can be used in a screen where there may be se several sliders and they are in a scroll view that will be scrolled by people swiping up and down on the screen…. With the current jump to a touch point on the slider then this is useless to try and use your compact slider control.

All you need to do to reproduce it is create some screen on iOS that has a grid or list with each item having a slider.. and then try and scroll up and down without causing the siders to change position as you swipe on the screen…

Dan

On Aug 1, 2022, at 10:30 AM, Alexey Bukhtin @.***> wrote:

Hey Thanks for reporting the issue. This is interesting case. Could you maybe provide my a screenshot or a code with layout to let me try to test and fix?

— Reply to this email directly, view it on GitHub https://github.com/buh/CompactSlider/issues/4#issuecomment-1201283232, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADHWCI7TZG7SCQJCDE4PPHTVW7NPVANCNFSM55DUS3OA. You are receiving this because you authored the thread.

buh commented 1 year ago

Thanks Dan! I think, I can fix it. I'll let you know

xianman commented 1 year ago

I do have a similar problem in my app. I have a scroll view with all of the settings in my app, which are various types of controls, ie. toggles, sliders, CompactSliders, segmented controller, etc. It all works well when the user scrolls the page, but if they accidentally touch the CompactSlider while trying to scroll the page, they in turn inadvertently will start dragging the CompactSlider. The desired action would be to ignore the touch if the user is swiping vertically, and only move the CompactSlider on horizontal swipe actions, like how a Slider typically works in a scroll view.

buh commented 1 year ago

Thanks for the feedback. I'll fix it soon.

buh commented 1 year ago

Guys, I think I fixed it in v1.1.2. Could you please check?

xianman commented 1 year ago

Guys, I think I fixed it in v1.1.2. Could you please check?

Working great, thanks Alexey!