-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Carousel: Separate draggable area from controls #33155
Merged
Mitch-At-Work
merged 17 commits into
microsoft:master
from
Mitch-At-Work:user/mifraser/carousel-drag-controls
Nov 1, 2024
Merged
Carousel: Separate draggable area from controls #33155
Mitch-At-Work
merged 17 commits into
microsoft:master
from
Mitch-At-Work:user/mifraser/carousel-drag-controls
Nov 1, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mitch-At-Work
force-pushed
the
user/mifraser/carousel-drag-controls
branch
2 times, most recently
from
October 29, 2024 16:47
9086b34
to
2c074fb
Compare
📊 Bundle size report
Unchanged fixtures
|
fabricteam
reviewed
Oct 29, 2024
change/@fluentui-react-carousel-2e2a03df-5a80-41c4-b8df-9745b659c556.json
Outdated
Show resolved
Hide resolved
packages/react-components/react-carousel/stories/src/Carousel/CarouselDefault.stories.tsx
Outdated
Show resolved
Hide resolved
packages/react-components/react-carousel/library/src/components/pointerEvents.ts
Outdated
Show resolved
Hide resolved
packages/react-components/react-carousel/library/src/components/pointerEvents.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO the current change in the structure does not scale 😐
I played with it a bit and I propose to try the following plan:
- Undo all changes & deprecate
CarouselSlider
- Create new
CarouselViewport
component that will haveroot
(i.e.embla__viewport
) &slider
(better name? i.e.embla__container
) slots - Undo changes in
useEmblaCarousel()
- Rename
containerRef
inuseEmblaCarousel()
toviewportRef
, addviewportRef
toCarouselContext
and consume it inCarouselViewport
. This way we avoid.querySelector()
inuseEmblaCarousel()
- Ensure that this still somehow works with deprecated
CarouselSlider
Mitch-At-Work
force-pushed
the
user/mifraser/carousel-drag-controls
branch
from
October 30, 2024 18:21
033ffe1
to
259922a
Compare
layershifter
approved these changes
Nov 1, 2024
packages/react-components/react-carousel/stories/src/Carousel/index.stories.tsx
Show resolved
Hide resolved
packages/react-components/react-carousel/stories/src/Carousel/CarouselDescription.md
Outdated
Show resolved
Hide resolved
packages/react-components/react-carousel/stories/src/Carousel/CarouselImageBox.stories.tsx
Outdated
Show resolved
Hide resolved
packages/react-components/react-carousel/stories/src/Carousel/CarouselBestPractices.md
Outdated
Show resolved
Hide resolved
...react-components/react-carousel/library/src/components/CarouselViewport/CarouselViewport.tsx
Outdated
Show resolved
Hide resolved
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previous Behavior
When 'draggable' was enabled on carousel the draggable area included anything in the main Carousel wrapper
New Behavior
Draggable now only enables draggable area within the CarouselSlider window
This aligns with the reccomended Embla pattern for draggable carousels:
https://www.embla-carousel.com/guides/previous-and-next-buttons/