Comments (4)
Hi @benamm๐
Can you describe your use case for the dynamic snap point in more detail? How should it work from your perspective?
I'll try to take a look at the snap point issue you mentioned when I have some free time to work on this project ๐
from react-modal-sheet.
Hey @Temzasse, I have a similar dynamic snap points use case. So i have two sets of snap points, which i pass as a prop using conditional operators, but i don't get the same animation as I would have got if the snap points were in same array.
Why I don't want these snap points in same array is because, when on a lower snap point, i do not want the sheet to go to a higher snap point. I wish if there was some way, where i can have the same animation as i get while switching snap points in my case where i am changing snap points array based on a condition.
Here is an example
<TheSheet
isOpen={isOpen || isSending}
initialSnap={initialSnap}
onClose={onCloseOfSheet}
disableDrag={disableDrag}
snapPoints={ [heighestSnapPoint, 340, 0] }
>
<TheSheet
isOpen={isOpen || isSending}
initialSnap={initialSnap}
onClose={onCloseOfSheet}
disableDrag={disableDrag}
snapPoints={selectedUser.length ? [340, 0] : [heighestSnapPoint, 0]}
>
from react-modal-sheet.
What would be the expected result when the snap points array is dynamically changed? Should it animate to the snap point that exists in at the current active snap point index ๐ค What if the new array has less snap points than the previous one?
from react-modal-sheet.
The expected use cases are, say there are two pages in a sheet and both the pages have different set of snap points. For them to be used in the same sheet,
-
When the second UI is shown based on a boolean condition, it should snap to it's set of snap points.
-
Now to do that, there can be two solutions
-> Give all the snap points in a single array and switch them according to which UI is rendered.
-> Provide separate set of snap point arrays and switch between those arrays based on the which UI is rendered.The issue with first is
-> We can't disable other snap points which are no more required, sheet can still use those snap points
The second solution has
-> No animation when the snap point array is changed. Like when for first time the sheet opens or when snap point changes
from a single array, that kind of animation is not there in the sheet.
I hope this explanation helps @Temzasse :)
from react-modal-sheet.
Related Issues (20)
- Unable to scroll behind the sheet, but able to click HOT 1
- Scroll flickering on iOS with Sheet.Scroller & inputs HOT 4
- Spring type animation
- Sheet is not opening on mobile browsers
- Sheet is not reopening in desktop Chrome HOT 3
- Allow style with Tailwind with className prop HOT 2
- initialSnap -34px bug HOT 2
- How do I implement a sticky footer? HOT 1
- Customer Header breaks dragging behavior
- Stacking sheets HOT 1
- TypeError: undefined is not an object (evaluating 'scrollable.scrollTop') HOT 1
- prevent Closing component HOT 2
- Sheet not closing on mobile HOT 8
- Bug on Safari Mobile, when switching the address bar up
- Bug: Mobile Safari input inside sheet stays behind when sheet moves HOT 4
- Bug: page overflow when mobile on screen keyboard is active (chrome) HOT 1
- Break tree shaking issue because of a "motion" HOT 3
- Close the sheet, but the component remains mounted with opacity 0. HOT 1
- Drag functionality with Scroller HOT 1
- Project Still Maintained? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-modal-sheet.