[BUG] Show and Hide Button Arrows
Closed this issue · 1 comments
mcaiza20 commented
Describe the bug
I have two carousels with the scroll but when I go down the page the arrows appear and disappear, it is a behavior that happens the same in your examples. How could I control that from the beginning they do not appear if they do not have more items on the scroll?
To Reproduce
Link to codesandbox where can see the bug or steps to reproduce the behavior:
- put a scroll at the end of the page
- Scroll down to scroll items
- See error
Expected behavior
If they do not have items they should not appear
Desktop (please complete the following information):
- Browser chrome 89, safari 14
- OS: MAC
- Mobile device (eg iPhone, Galaxy etc)
asmyshlyaev177 commented
Can hide arrows by default, and when items updated they will appear if there are scroll.
const isFirstItemVisible = visibility.useIsVisible('first', true);
const isLastItemVisible = visibility.useIsVisible('last', true);
Second value in useIsVisible
is default value, e.g. before first update.
Will dig into it more tomorrow.