Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[README].appleScrollBehavior: Buttons are disabled in position .middle #18

Closed
jagodki opened this issue Jul 14, 2021 · 12 comments
Closed
Labels
bug Something isn't working Thank You ❤️ For people who appreciate my work

Comments

@jagodki
Copy link

jagodki commented Jul 14, 2021

Hi,

first of all, you did an amazing job with this project :)

I implemented the bottom sheet on top of a map view without customising the positions and placed a some buttons on the bottom sheet. My problem is, that the buttons are disabled, when the bottom sheet is not in position .top:

Bildschirmfoto 2021-07-14 um 21 24 45

If the bottom sheet will be pulled up to the .top-position, the buttons will not be disabled anymore:
Bildschirmfoto 2021-07-14 um 21 25 39

Is this a feature (that can be customised) it or is it a bug?

Best Regards,
Christoph

@lucaszischka
Copy link
Owner

Hello Christoph,

First of all thank you for your kind words.

Now to your issue. The problem is caused because you are using the following option .appleScrollBehavior.
Internally it disables the ScrollView, to prevent it from scrolling except when it is at the .top position, to mimic Apples BottomSheet. But because of inheritance it looks like the Buttons also get disabled.

This is not the intended behavior and as soon as I have time I will fix this. But for now I suggest you to add .enabled(true) to all of your buttons (I hope this will fix this for now).

Greetings,
Lucas

@lucaszischka lucaszischka self-assigned this Jul 14, 2021
@lucaszischka lucaszischka added the bug Something isn't working label Jul 14, 2021
@jagodki
Copy link
Author

jagodki commented Jul 15, 2021

Thank you for your timely response. I can confirm, that the problem is related to the option .appleScrollBehavior.

@lucaszischka
Copy link
Owner

Hello, so I tested it and I figured out, that .disabled(false) has no effect because it is overridden by the ScrollView property.

Now I have the following options: implement a completely custom implementation of UIScrollView or using the Introspect library.

Using the introspect library works fine, but I’m not sure if I want to add an dependency to another package.

Greetings Lucas

@jagodki
Copy link
Author

jagodki commented Jul 16, 2021

Adding dependencies to another library would not be the best architecture. On the other side, Introspect is a productive ready library. Maybe it could be implemented as a non mandatory feature, so that users of BottomSheet have also the choice to use Introspect and if they don't want, the .appleScrollBehaviour works in the same way as at the moment.

@lucaszischka
Copy link
Owner

Im currently trying to implement my own adoption for UIScrollView, because I could not only solve your but also a couple more issues or add features by implementing this.

lucaszischka added a commit that referenced this issue Jul 21, 2021
This fixes #8 because it no longer relies on `.disabled()` as it uses `Introspect` instead. This is only a temporary solution, as i don't want to rely on other packages and as im planning to port my own UIScrollView to SwiftUI. The custom port would fix this issue and could make other features on my ToDo List (see #11) possible.
@lucaszischka
Copy link
Owner

lucaszischka commented Jul 21, 2021

Please have a look at #temp-fix-18, as it fixes your issue. For now you can just use this branch instead, until I implement a better solution. I will keep this branch up to date and I will leave this issue open until I found a better fix.
But please keep in mind, that im really busy at the moment I don't have an ETA for the final fix.

I also changed the title of this issue to make it easier for other users to find a quick solution.

I hope this works for you,
Lucas

@lucaszischka lucaszischka changed the title Buttons are disabled in position = .middle **[Readme]**.appleScrollBehavior: Buttons are disabled in position .middle Jul 21, 2021
@lucaszischka lucaszischka changed the title **[Readme]**.appleScrollBehavior: Buttons are disabled in position .middle [README].appleScrollBehavior: Buttons are disabled in position .middle Jul 21, 2021
@jagodki
Copy link
Author

jagodki commented Jul 24, 2021

Great work, it works like a charm. Thank you for you effort :)

@lucaszischka lucaszischka added the Thank You ❤️ For people who appreciate my work label Sep 3, 2021
@LinusGeffarth
Copy link

LinusGeffarth commented Oct 19, 2021

Hey there, any update on this? Should we still use temp-fix-18 instead? Seems the branch is a little behind main...

@lucaszischka
Copy link
Owner

Hey, yes please still use temp-fix-18 unitl i have time to complete a better solution. The branch is up to date, only some LFS changes and Code cleanup is missing.

@niklasgrewe
Copy link

niklasgrewe commented Nov 11, 2021

@LucasMucGH thanks for this fix. Could you also do this for List {}? instead of using scrollView, i want to use a List (as parent component) and i also need the behavior, that only scrolling should be disabled in the .middle state. When using List { }.disabled(true), my buttons are disabled too. That would be awesome if you could provide a similiar solution like with ScrollView 👍

@MarcoCadei
Copy link

MarcoCadei commented Nov 27, 2021

When trying to use temp-fix-18 I get an error

Couldn’t check out revision ‘5b66c3163049688117a3a3d1b7df92bf18c2578a’:
Downloading Assets/ArtistSongsView.gif (14 MB)

It seems related to git lfs. @LucasMucGH can you please check?

Btw, great work with the lib, keep it up! 🚀

@lucaszischka
Copy link
Owner

In favour of #39 im closing this issue now. In the next days the #temp-fix-18 branch will be deleted and a final solution will be in the main branch.

@lucaszischka lucaszischka removed their assignment Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Thank You ❤️ For people who appreciate my work
Projects
None yet
Development

No branches or pull requests

5 participants