Closed majugurci closed 4 years ago
I am having the same issue with the left arrow on the original screen, once I scroll (scrollable true) the arrow appears.
RNCS uses RecyclerListView which returns inconsistent information to the scrolling callback. I'll try to investigate as time permits. I could use some help debugging this. Set breakpoints in onVisibleIndicesChanged()
in Scroller.js
to see the data it returns. Console logs are helpful to see it in real time.
Which device(s) did you test on?
2.0.6 has been published which contains another bug fix that could be related.
I just upgraded 2.0.6 and tested on Android, will get an iPhone build later. Interesting result, I can try and debug in a bit. But what I see, the RNCS draws correctly and all seems good, then it rerenders with a different font and the text gets smaller (assuming resizing for screen) and lose the arrow. 2.0.5 still has some jitter on my iPhone 11.
Oh and most importantly; had an arrow before pretender, then no arrow until I touch the screen to start scrolling. Once I start scrolling the left arrow appears.
I suspect onVisibleIndicesChanged()
is giving unexpected results. Was your project created with create-react-native-app
or react-native init
? It would help speed up debugging this if you could upload a minimal repo which exhibits that behavior.
@majugurci After updating to 2.0.6, the arrows remain visible at the ends, which is different than before. Better but still not fully correct. I tested both your Snack and the example app in this repo. You may need to update the package.json because it doesn't allow me to save to your project.
After upgrading to v2.0.6 there are no arrow at all. I tried it with snack's virtual device and on actual device. If I downgrade to v2.0.5 then arrows are visible. So I could not test the original use case. Has there been any change with icons that I have missed?
As i see it:
Here is a link: snack
I tested your snack in an Android simulator as well as in the Snack's web player. They're both showing the navigation arrows. What device(s) are you testing on?
Try clearing the npm cache in case it's using stale code:
npm install
npm start -- --reset-cache
Ctrl-C
.npm start
(or react-native run-...
for native projects).The --reset-cache
flag requires @react-native-community/cli-tools:
npm install @react-native-community/cli-tools --global
I pushed a fix for the scrollable nav arrow logic. It shows/hides correctly at the ends. Scrolling right near the end of the dates works better.
You can use the updated code by pointing to this repo directly in package.json
. Run npm install
after changing it.
"dependencies": {
"react-native-calendar-strip": "https://github.com/BugiDev/react-native-calendar-strip",
...
}
I have tried again and it seems it was some kind of a cache issue. I'm testing it only through snack (once I return to my project I can test it on dev machine). Expo snack does not allow this: "react-native-calendar-strip": "https://github.com/BugiDev/react-native-calendar-strip" so I cannot test it currently (it only allows sem ver). But after cache has been cleared arrows are shown, it is working better. But there are still some issues (I don't know if they are fixed in newer version).
The fix has been published in 2.0.7
It seems to work perfectly this time. Thank you for your efforts.
In some cases right arrow is missing and by clicking right arrow you cannot go to the last date. I hope these images make it clearer:
Scrolled to the last date:
Scrolled just so last day is not visible = no right arrow
And finally scrolled one more day (so 2 days at the end are not visible) = right arrow is visible but pressing it will move just one day, not 2 days as expected
Reproducible example: Expo snack