ui-carousel: Fix unnecessary scroll of carousel items into view - #155
Conversation
Deploying ui with
|
| Latest commit: |
5882e73
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://82e641cc.ui-2wg.pages.dev |
| Branch Preview URL: | https://carousel-scroll-fix.ui-2wg.pages.dev |
|
So we still move a full card width for the sake of a pixel off screen which can feel a bit weird when your click target was fully visible. Say in a two-cards-minus-one-pixel width setup, RH edge just off screen click clearly visible and 100% on-screen button. Maybe the click target should stop propagation (untested) ? Let's chat briefly about this tomorrow. |
Or as Claude suggests:
|
Pressing a visible card control (e.g. the project menu button) focuses it, which moved the carousel if the card overlapped Swiper's content box by even a pixel. Only keyboard focus now slides a card into view.
|
Added the modality fix. Couldn't use react-aria's notion as it's React state which can be updated too late for the carousel but easy enough to track by hand. |
Adds a story for a carousel of project cards with actions used to reproduce the bug and test the fix.
Closes #154