mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
Fix Unknown prop placement
warning of Dropdown.Button, close #5594
This commit is contained in:
parent
58e521de71
commit
ec87110482
@ -36,7 +36,7 @@ const menu = (
|
||||
|
||||
ReactDOM.render(
|
||||
<div>
|
||||
<Dropdown.Button onClick={handleButtonClick} overlay={menu}>
|
||||
<Dropdown.Button onClick={handleButtonClick} overlay={menu} placement="bottomLeft">
|
||||
Dropdown
|
||||
</Dropdown.Button>
|
||||
<Dropdown.Button
|
||||
|
@ -18,6 +18,7 @@ export interface DropdownButtonProps {
|
||||
onVisibleChange?: (visible: boolean) => void;
|
||||
style?: React.CSSProperties;
|
||||
children?: any;
|
||||
placement?: 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight';
|
||||
}
|
||||
|
||||
export default class DropdownButton extends React.Component<DropdownButtonProps, any> {
|
||||
@ -38,7 +39,7 @@ export default class DropdownButton extends React.Component<DropdownButtonProps,
|
||||
render() {
|
||||
const {
|
||||
type, overlay, trigger, align, children, className, onClick, prefixCls,
|
||||
disabled, visible, onVisibleChange, ...restProps,
|
||||
disabled, visible, onVisibleChange, placement, ...restProps,
|
||||
} = this.props;
|
||||
const cls = classNames(prefixCls, className);
|
||||
|
||||
@ -47,6 +48,7 @@ export default class DropdownButton extends React.Component<DropdownButtonProps,
|
||||
overlay,
|
||||
trigger: disabled ? [] : trigger,
|
||||
onVisibleChange,
|
||||
placement,
|
||||
};
|
||||
|
||||
if ('visible' in this.props) {
|
||||
|
Loading…
Reference in New Issue
Block a user