ant-design/components/tooltip/demo/auto-adjust-overflow.md
xrkffgg 01b98e79d9
docs: optimize site of components 3 (#23779)
* docs: optimize site of components in rtl 3

* add
2020-04-30 21:04:19 +08:00

897 B

order title debug
3
zh-CN en-US
自动调整位置 Adjust placement automatically
true

zh-CN

气泡框不可见时自动调整位置

en-US

Adjust placement automatically when tooltip is invisible.

import { Tooltip, Button } from 'antd';

const wrapStyles = {
  overflow: 'hidden',
  position: 'relative',
  padding: '24px',
  border: '1px solid #e9e9e9',
};

ReactDOM.render(
  <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>,
  mountNode,
);