-
Notifications
You must be signed in to change notification settings - Fork 350
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
Popover, Dropdown, PopoverEducational: support forcePosition
prop
#3744
Conversation
✅ Deploy Preview for gestalt ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for gestalt ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@AlbertCarreras I think we should reconsider the API for force positioning. What if we'll need forceLeft, forceUp in the future? I would suggest to introduce |
The new prop doesn't have to be |
forceDown
and forceRight
forcePosition
prop
a96fc75
to
b7448d3
Compare
let placement: Placement = direction ?? 'bottom'; | ||
const isRtl = typeof document === 'undefined' ? false : document?.dir === 'rtl'; | ||
|
||
if (isRtl && direction === 'left') { |
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.
@AlbertCarreras have you tested this bahvior? I thought @floating-ui library already handled RTL. 🤔
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.
It might flip accordingly... but if we force behavior idk... I'll test it anyways.
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.
just tested it... no, when forced... it stays i the right/left, cos they don't do end/start and we read LRT/LTR from the document
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.
LGTM
BREAKING CHANGE:
We are deprecating idealPosition: forceDown
Popover, Dropdown, PopoverEducational: support
forcePosition
propTest example here: https://deploy-preview-3744--gestalt.netlify.app/web/popover#Ideal-direction