ant-design/components/tooltip/demo/auto-adjust-overflow.tsx

33 lines
735 B
TypeScript

import React from 'react';
import { Button, Tooltip } from 'antd';
const wrapStyles: React.CSSProperties = {
overflow: 'hidden',
position: 'relative',
padding: '24px',
border: '1px solid #e9e9e9',
};
const App: React.FC = () => (
<div style={wrapStyles}>
<Tooltip
placement="left"
title="Prompt Text"
getPopupContainer={(trigger) => trigger.parentElement!}
>
<Button>Adjust automatically / </Button>
</Tooltip>
<br />
<Tooltip
placement="left"
title="Prompt Text"
getPopupContainer={(trigger) => trigger.parentElement!}
autoAdjustOverflow={false}
>
<Button>Ignore / </Button>
</Tooltip>
</div>
);
export default App;