Skip to content

Commit

Permalink
[@mantine/core] Fix incorrect Tooltip and Popover arrow styles for RTL (
Browse files Browse the repository at this point in the history
  • Loading branch information
rtivital committed Aug 18, 2022
1 parent d8c98ea commit f221971
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
Expand Up @@ -68,8 +68,8 @@ export function getArrowPositionStyles({
return {
...baseStyles,
...horizontalSide(placement, arrowSize, arrowOffset),
[dir === 'ltr' ? 'right' : 'left']: arrowPosition,
[dir === 'ltr' ? 'borderLeft' : 'borderRight']: 0,
right: arrowPosition,
borderLeft: 0,
borderBottom: 0,
};
}
Expand All @@ -78,8 +78,8 @@ export function getArrowPositionStyles({
return {
...baseStyles,
...horizontalSide(placement, arrowSize, arrowOffset),
[dir === 'ltr' ? 'left' : 'right']: arrowPosition,
[dir === 'ltr' ? 'borderRight' : 'borderLeft']: 0,
left: arrowPosition,
borderRight: 0,
borderTop: 0,
};
}
Expand Down
18 changes: 4 additions & 14 deletions src/mantine-core/src/Tooltip/Tooltip.story.tsx
Expand Up @@ -5,25 +5,15 @@ import { Group } from '../Group';

export default { title: 'Tooltip' };

export const Usage = () => {
const [opened, setOpened] = useState(false);
export function Usage() {
return (
<div style={{ padding: 40 }}>
<Tooltip
position="bottom"
label="Use this button to save this information in your profile, after that you will be able to access it any time and share it via email."
width={300}
multiline
events={{ focus: true, hover: true, touch: false }}
withinPortal={false}
>
<Button fullWidth onClick={() => setOpened(!opened)}>
target
</Button>
<Tooltip position="right" label="Tooltip label" withArrow>
<Button>target</Button>
</Tooltip>
</div>
);
};
}

export const TooltipGroup = () => (
<Tooltip.Group openDelay={500}>
Expand Down

0 comments on commit f221971

Please sign in to comment.