Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tooltip] Fix broken arrow position in rtl #27868

Merged
merged 6 commits into from Aug 23, 2021

Conversation

mnajdova
Copy link
Member

@mnajdova mnajdova commented Aug 20, 2021

Fixes #27858 The fix was to prevent some styles from flipping in rtl. As /* @noflip */ is working only with string templates, I've added the isRtl prop and added the appropriate styles based on it.

Isolated codesandbox examples

Codesandbox in RTL on master:

https://codesandbox.io/s/material-demo-forked-qh2ds?file=/demo.js

Codesandbox in RTL on next:

https://codesandbox.io/s/basictooltip-material-demo-forked-5gc67?file=/demo.js

Codesandbox using the packages in the PR:

https://codesandbox.io/s/basictooltip-material-demo-forked-44bhg?file=/demo.js

-----

Docs demos:

Next docs 馃槩 :

Current PR docs:

@mui-pr-bot
Copy link

mui-pr-bot commented Aug 20, 2021

Details of bundle changes (experimental)

Generated by 馃毇 dangerJS against 587fb21

@mnajdova mnajdova marked this pull request as ready for review August 20, 2021 16:09
@mnajdova mnajdova changed the title [WIP][Tooltip] Fix arrow in rtl [Tooltip] Fix broken arrow position in rtl Aug 20, 2021
@@ -63,32 +63,38 @@ const TooltipPopper = styled(Popper, {
...(ownerState.arrow && {
[`&[data-popper-placement*="bottom"] .${tooltipClasses.arrow}`]: {
top: 0,
left: 0,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are already defined in the style attribute, no need to specify them.

@oliviertassinari oliviertassinari added bug 馃悰 Something doesn't work component: tooltip This is the name of the generic UI component, not the React module! labels Aug 21, 2021
Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. I guess the change of behavior between v4 and v5 is linked to the flip option that we do no longer have available: https://github.com/mui-org/material-ui/blob/120c564109245a3b070b1cbaf2c9f3f8659fd9fa/packages/material-ui/src/Tooltip/Tooltip.js#L652

@mnajdova
Copy link
Member Author

Looks great. I guess the change of behavior between v4 and v5 is linked to the flip option that we do no longer have available

ah I didn鈥檛 noticed it, but yes, looks like it comes from it. We missed to catch it during the migration.

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. I guess the change of behavior between v4 and v5 is linked to the flip option that we do no longer have available:

I guess we need to go through every component that had this or rather check every usage of flip: false from master against the behavior of next.

@mnajdova
Copy link
Member Author

I guess we need to go through every component that had this or rather check every usage of flip: false from master against the behavior of next.

Yes will do this today

@mnajdova mnajdova merged commit c76ea73 into mui:next Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 馃悰 Something doesn't work component: tooltip This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Tooltip] Arrow position issue in RTL v5
4 participants