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

feat: expand on content drag #141

Merged
merged 1 commit into from
Jun 23, 2021
Merged

feat: expand on content drag #141

merged 1 commit into from
Jun 23, 2021

Conversation

mekedron
Copy link
Contributor

@mekedron mekedron commented Jun 20, 2021

It works a little harshly on iOS devices because they have the overscroll that cannot be smoothly disabled.
BUT! It works in my opinion good enough to use it if it's critical for the project.

If somebody needs it before it's merged or declined I've already uploaded the feature on NPM:
https://www.npmjs.com/package/n1k1tk-react-spring-bottom-sheet
It will be removed from npm after it's merged or stay if declined.

ezgif-7-501c21bb50c5

@stipsan
Copy link
Owner

stipsan commented Jun 20, 2021

Copy link
Owner

@stipsan stipsan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow this is incredible 🤯 just tested it on my iPhone, I see what you mean by the over scroll behavior not being interruptible. Not like native Apple Maps for example, but still it feels really nice and is a great improvement 👍 might change it to on by default later, after enough testing in the wild just to make sure it doesn't break other components people might have in the sheet. Like slider components and similar ☺️

@stipsan stipsan merged commit ec733a5 into stipsan:main Jun 23, 2021
github-actions bot pushed a commit that referenced this pull request Jun 23, 2021
# [3.4.0](v3.3.0...v3.4.0) (2021-06-23)

### Features

* expand on content drag ([#141](#141)) ([ec733a5](ec733a5))
@github-actions
Copy link

🎉 This PR is included in version 3.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mekedron
Copy link
Contributor Author

@stipsan I’m glad you like it!
I see at least a one way how it can be improved to be like in Apple Maps.
But it’s hard to achieve and I’m not sure there any good solutions for it.

In Apple Maps when you start dragging the content from the min snap and reach the max snap, and then keep moving your finger up, the scroll event starts and the content are being scrolled down. I don’t know how it can be achieved because when the scroll event starts the useDrag function is interrupted.
And I can’t find a way to make these two events work together.
But of course there is a crutch can be created, I mean a custom scrolling by useDrag can be implemented when we reach to the max snap, but honestly I don’t like this idea too much, haha.

github-actions bot pushed a commit to la55u/react-spring-bottom-sheet-updated that referenced this pull request Jun 18, 2023
# 1.0.0 (2023-06-18)

### Bug Fixes

* add 18 to react peer dep ([d89c0bb](d89c0bb))
* add CSS sourcemap ([04bf99f](04bf99f))
* add keywords ([05f4399](05f4399))
* add more NaN type guards ([7664d1a](7664d1a))
* API cleanup ([dc2b126](dc2b126))
* avoid dividing by zero during prerender ([ca2b9ae](ca2b9ae))
* better type declarations ([c19dd44](c19dd44))
* better velocity physics ([65390c7](65390c7))
* can be clicked through the overlay on IOS ([b9a2d95](b9a2d95))
* **deps:** bump focus-trap ([a099a54](a099a54))
* **deps:** update dependency @reach/portal to ^0.13.0 ([stipsan#94](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/94)) ([1cc8056](1cc8056))
* **deps:** update dependency focus-trap to v6.2.2 ([9f79d35](9f79d35))
* doh, semantic release pushed v1.0 instead of v0.2 :( ([a5837bd](a5837bd))
* dragging can overshoot if onDismiss is undefined ([stipsan#43](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/43)) ([549ab30](549ab30))
* export prop types ts definitions ([36cf999](36cf999))
* fade out correctly on snap ([17234bc](17234bc))
* filter out taps on drag ([bc709a0](bc709a0))
* guard against NaN in minSnap and maxSnap handlers ([7dbf037](7dbf037))
* improve rubber band effect when out of bounds ([stipsan#29](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/29)) ([4f2fe09](4f2fe09))
* improve TS definitions ([a8102bf](a8102bf))
* iOS display cutouts caused a scrollbar in some cases ([45c182c](45c182c))
* make open transitions more interruptible on iOS ([stipsan#23](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/23)) ([f898dd0](f898dd0))
* microbundle defaults to preact, changed it back to react ([4f52355](4f52355))
* more stable defaultSnap RESIZE sync ([230dbe2](230dbe2))
* only animate on RESIZE if the source = element ([ceb3671](ceb3671))
* readjust defaultSnap on resize ([b812786](b812786))
* remove padding wrappers ([stipsan#57](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/57)) ([60657fb](60657fb))
* RESIZE should never animate the content opacity ([2470ccc](2470ccc))
* rewrite interpolations to always be in frame sync ([cc43467](cc43467))
* TS in microbundle breaks on [...(new Set)], swapping to Array.from ([2402b5a](2402b5a))
* update readme ([ceb55d3](ceb55d3))
* updated readme with more API docs and examples ([6a48fab](6a48fab))
* use layout effect to prevent tearing on Safari ([6b62559](6b62559))
* use rAF instead of timeout to schedule unmount ([7f3c018](7f3c018))
* v2 api ready, just need to clean up and write docs ([96f158e](96f158e))
* xstate deprecation warning on null events ([e44e273](e44e273))

### Features

* add height getter to ref ([51c8510](51c8510))
* Add RESIZE events ([b3ff691](b3ff691))
* add sibling prop support ([767215b](767215b))
* add skipInitialTransition to make skipping opt-in ([f200ad0](f200ad0))
* add source to RESIZE events ([383e206](383e206)), closes [stipsan#53](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/53)
* add springConfig prop ([1a96832](1a96832))
* allow the developer to disable focus trap ([stipsan#138](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/138)) ([ef176b3](ef176b3))
* expand on content drag ([stipsan#141](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/141)) ([ec733a5](ec733a5))
* initial version ([ef3ecfa](ef3ecfa))
* override source and velocity in snapTo ([1afe79f](1afe79f))
* refactor to xstate ([stipsan#46](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/46)) ([6b2f92a](6b2f92a))
* SNAP events now have `source` ([240c212](240c212)), closes [stipsan#87](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/87)
* V2 ([stipsan#17](https://github.com/la55u/react-spring-bottom-sheet-updated/issues/17)) ([8331800](8331800))

### BREAKING CHANGES

* The resize observer logic is rewritten to no longer require wrapper elements like `[data-rsbs-footer-padding]`. If you're not using custom CSS and are simply importing `react-spring-bottom-sheet/dist/style.css` in your app then this isn't a breaking change for you.

If you're using custom CSS, here's the breaking changes:
- `[data-rsbs-header-padding]` removed, update selectors to `[data-rsbs-header]`
- `[data-rsbs-content-padding]` removed, update selectors to `[data-rsbs-scroll]`
- `[data-rsbs-footer-padding]` removed, update selectors to `[data-rsbs-footer]`
- `[data-rsbs-antigap]` removed, update selectors to `[data-rsbs-root]:after` and make sure to add `content: '';`.
- `[data-rsbs-content]` is changed, update selectors to `[data-rsbs-scroll]`.
- The `<div style="overflow:hidden;">` wrapper that used to be between `[data-rsbs-content]` and `[data-rsbs-content-padding]` is now within `[data-rsbs-scroll]`, and no longer hardcode `overflow: hidden`, add `[data-rsbs-content] { overflow: hidden; }` to your CSS.
* this is the real initial release, `v1` is fake software.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants