Added support for components with vertical scroll #163
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #138
Showkase wasn't able to preview components that contained vertical scroll functionality. This was due to a check added by Compose internally to crash on nested scroll components when the scrollers are in the same direction. This is an intentional design decision by Compose. I'm adding a screenshot below to explain why this design decision was made for anyone that is curious.
You might ask why this happens in Showkase even when a component doesn't have a nested scroller. That's because the Showkase browser itself is written in Compose and it renders all the components inside a
LazyColumn
. That's why when you tried entering a screen where the components with a scroller are being previewed, it would crash.In this PR, I add a
maxHeight
limit that's equal to the size of the screen to the card that previews the component. This ensures that each component is only occupying at most the height of the screen. This is a reasonable size limit as most components should be able to sufficiently render their preview.@BenSchwab @elihart @Dambakk