Comments (6)
you have this handler on props
onSnap={snapIndex => console.log('> Current snap point index:', snapIndex) }
is the index from snapPoints array
snapPoints={[600, 400, 100, 0]}
initialSnap={1}
from react-modal-sheet.
@nickbyte can you provide a repro of this issue in CodeSandbox? Or did you figure it out?
Your problem might be related to you changing the container height which will probably mess with the snap point calculations within the library 🤔
from react-modal-sheet.
I have the same problem. It gives a valid snapoint index on load but after dragging, it always gives -1.
from react-modal-sheet.
@Temzasse I found the issue:
I was using your example from
https://github.com/Temzasse/react-modal-sheet/blob/master/example/components/SnapPoints.tsx
but if you change the snapPoints all to percentages like:
const snapPoints = [0.9, 0.6, 0.3, 0];
And just appear when dragging in responsive view
codesandbox
from react-modal-sheet.
I am having the same problem, I used the following props
<Sheet
snapPoints={[0.925, 0.53, 0.19]}
initialSnap={2}
onSnap={(snapIndex) => {
console.log(snapIndex);
}} .../>
but it is giving the actual snap index on load only. Otherwise, it returns -1.
is there any way I can get the current snap index?
from react-modal-sheet.
Thanks for reporting this 🙏🏻 This should be fixed in version 1.6.1 🙂
from react-modal-sheet.
Related Issues (20)
- Content goes out of Sheet on Safari HOT 3
- Features for split pane
- `onClick` is missing from backdrop props HOT 2
- How can I keep the modal sheet opened using snap points?
- Iphone Keyboard Issue when we have input in content HOT 4
- Strange behaviour after screen orientation changes HOT 3
- framer-motion is not tree-shaking HOT 1
- 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
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.