buh / CompactSlider

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

CompactSlider's action not working inside a Form #5

Closed Kyle-Ye closed 1 year ago

Kyle-Ye commented 1 year ago

Describe the bug

Both Tap&Drag is not working when CompactSlider is inside in a Form.

Normal Slider works properly.

To Reproduce Steps to reproduce the behavior:

struct DemoView: View {
    @State private var progress = 0.0
    var body: some View {
        Form {
            Section {
                Slider(value: $progress, in: 0.0 ... 1.0, step: 0.001) {
                    Text("Progress \(progress, format: .percent)")
                }
                CompactSlider(value: $progress, in: 0.0 ... 1.0, step: 0.01) {
                    Text("Progress")
                    Spacer()
                    Text("\(progress, format: .percent)")
                }
            }
        }
    }
}

Expected behavior

Both Slider and CompactSlider work properly.

Screenshots

IMG_0407

Platform and version:

Additional context

It's working on Simulator but not on real device.

If CompactSlider is in a normal VStack, it will also work properly.

Kyle-Ye commented 1 year ago

Also tested on the following config:

CompactSlider on Form:
iOS 16.1 beta 3 + iPhone 14 Pro Max ❌
iOS 16.0.1 + iPhoneXs ✅
macOS 13 beta 10 ✅
buh commented 1 year ago

I'll take a look, but don't you think it could be an issue of the iOS 16.1 beta 3? 🤔

Kyle-Ye commented 1 year ago

I'll take a look, but don't you think it could be an issue of the iOS 16.1 beta 3? 🤔

+1. Will wait for the RC/Release version to see if the bug still exists.

Kyle-Ye commented 1 year ago

I'll take a look, but don't you think it could be an issue of the iOS 16.1 beta 3? 🤔

Still failing on the release of 10.24.

iPhone 14 Pro Max (iOS 16.1) + Xcode 14.1 RC 2

CSolanaM commented 1 year ago

Same happening here with an iPhone 13 Pro (iOS 16.1.1). It is working perfectly in the simulator, an iPhone 14 Pro Max (iOS 16.1).

If it's inside a Form, it doesn't work in the real device, but it does in the simulator. Weird.

Could you share you latest findings regarding this? Thank you. I'll do if I find something.

buh commented 1 year ago

I'll check on device

buh commented 1 year ago

I updated the Demo App and added Form examples. It looks like it works for me ¯\_(ツ)_/¯ Could you please try or provide some code where it doesn't work?

Kyle-Ye commented 1 year ago

I updated the Demo App and added Form examples. It looks like it works for me ¯_(ツ)_/¯ Could you please try or provide some code where it doesn't work?

It is fine on my iPhone XS + iOS 16.1. But still failing on iPhone 14 Pro Max.

The code is provided on the first post.

I suspect it has nothing to do with OS version. And the device model is the key to reproduce.

Currently it is failing on iPhone 13 Pro (iOS 16.1.1) & iPhone 14 Pro Max (iOS 16.1), other device model's case is unknown.

buh commented 1 year ago

I made a fix, please check, v.1.1.3

Kyle-Ye commented 1 year ago

Confirm to be fixed. Thanks