From 36058f7173a0d723ea76f77f75633a7bfd199c6f Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 7 Oct 2016 15:30:05 +0800 Subject: [PATCH] Fix arrowPointAtCenter not work in Popconfirm --- components/popconfirm/index.tsx | 6 ++---- components/popover/demo/placement.md | 2 +- components/popover/index.tsx | 10 ++-------- components/tooltip/index.tsx | 2 +- components/{popover => tooltip}/placements.tsx | 0 5 files changed, 6 insertions(+), 14 deletions(-) rename components/{popover => tooltip}/placements.tsx (100%) diff --git a/components/popconfirm/index.tsx b/components/popconfirm/index.tsx index 8e76af4e1e..d6af894017 100644 --- a/components/popconfirm/index.tsx +++ b/components/popconfirm/index.tsx @@ -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 { } 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 { return ( LB -
+
diff --git a/components/popover/index.tsx b/components/popover/index.tsx index 527f416863..7d1f0acd91 100644 --- a/components/popover/index.tsx +++ b/components/popover/index.tsx @@ -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 { render() { return ( - - {this.props.children} - + /> ); } diff --git a/components/tooltip/index.tsx b/components/tooltip/index.tsx index 335061a7ef..b05fc21ca5 100644 --- a/components/tooltip/index.tsx +++ b/components/tooltip/index.tsx @@ -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 = diff --git a/components/popover/placements.tsx b/components/tooltip/placements.tsx similarity index 100% rename from components/popover/placements.tsx rename to components/tooltip/placements.tsx