mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 19:19:57 +08:00
Fix arrowPointAtCenter not work in Popconfirm
This commit is contained in:
parent
6df2100a5c
commit
36058f7173
@ -2,7 +2,6 @@ import React from 'react';
|
||||
import Tooltip from '../tooltip';
|
||||
import Icon from '../icon';
|
||||
import Button from '../button';
|
||||
import getPlacements from '../popover/placements';
|
||||
import splitObject from '../_util/splitObject';
|
||||
|
||||
const noop = () => {};
|
||||
@ -93,9 +92,9 @@ export default class Popconfirm extends React.Component<PopconfirmProps, any> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const [{ prefixCls, title, placement, arrowPointAtCenter }, restProps] = splitObject(
|
||||
const [{ prefixCls, title, placement }, restProps] = splitObject(
|
||||
this.props,
|
||||
['prefixCls', 'title', 'placement', 'arrowPointAtCenter']
|
||||
['prefixCls', 'title', 'placement']
|
||||
);
|
||||
let { okText, cancelText } = this.props;
|
||||
if (this.context.antLocale && this.context.antLocale.Popconfirm) {
|
||||
@ -120,7 +119,6 @@ export default class Popconfirm extends React.Component<PopconfirmProps, any> {
|
||||
return (
|
||||
<Tooltip
|
||||
{...restProps}
|
||||
builtinPlacements={getPlacements({ arrowPointAtCenter })}
|
||||
prefixCls={prefixCls}
|
||||
placement={placement}
|
||||
onVisibleChange={this.onVisibleChange}
|
||||
|
@ -50,7 +50,7 @@ ReactDOM.render(
|
||||
<Button>LB</Button>
|
||||
</Popover>
|
||||
</div>
|
||||
<div style={{ width: buttonWidth, marginLeft: buttonWidth*4 + 24 }}>
|
||||
<div style={{ width: buttonWidth, marginLeft: (buttonWidth * 4) + 24 }}>
|
||||
<Popover placement="rightTop" title={text} content={content} trigger="click">
|
||||
<Button>RT</Button>
|
||||
</Popover>
|
||||
|
@ -1,8 +1,5 @@
|
||||
import React from 'react';
|
||||
import Tooltip from '../tooltip';
|
||||
import getPlacements from './placements';
|
||||
|
||||
const placements = getPlacements();
|
||||
|
||||
export interface PopoverProps {
|
||||
/** trigger type, options: `hover` `focus` `click` */
|
||||
@ -47,14 +44,11 @@ export default class Popover extends React.Component<PopoverProps, any> {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Tooltip transitionName={this.props.transitionName}
|
||||
builtinPlacements={placements}
|
||||
<Tooltip
|
||||
ref="tooltip"
|
||||
{...this.props}
|
||||
overlay={this.getOverlay()}
|
||||
>
|
||||
{this.props.children}
|
||||
</Tooltip>
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { cloneElement } from 'react';
|
||||
import RcTooltip from 'rc-tooltip';
|
||||
import getPlacements from '../popover/placements';
|
||||
import getPlacements from './placements';
|
||||
import classNames from 'classnames';
|
||||
|
||||
export type PopoverPlacement =
|
||||
|
Loading…
Reference in New Issue
Block a user