-
Notifications
You must be signed in to change notification settings - Fork 5k
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
fix: rtl support for embla carousel (Slider component) #11995
Conversation
✅ Deploy Preview for ethereumorg ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@pettinarip Okay, I'll take a look, thanks! |
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.
@wackerow I could test it anyway. Nice job, well done.
export interface IProps { | ||
children?: React.ReactNode | ||
onSlideChange?: (slideIndex: number) => void | ||
} | ||
|
||
const Slider: React.FC<IProps> = ({ children, onSlideChange }) => { | ||
const [emblaRef, embla] = useEmblaCarousel() | ||
const { flipForRtl, direction } = useRtlFlip() | ||
const [emblaRef, embla] = useEmblaCarousel({ direction }) |
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.
👍🏼
Builds on #11905 -- DO NOT MERGE before that PR
Description
useRtlFlip
hook to also returnisRtl
anddirection
for convenience in niche cases where these may be needed to further adjust a component for RTL details.direction
("rtl" | "ltr"
) touseEmblaCarousel
(see embla docs)Screen.Recording.2024-01-20.at.10.49.29.mov
Related Issue