Merge pull request #15156 from ant-design/date-picker-popup

fix configProvider getPopupContainer not work with DatePicker
This commit is contained in:
偏右 2019-03-04 19:04:27 +08:00 committed by GitHub
commit 19d916fd20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,13 +130,15 @@ export default function wrapPicker(Picker: React.ComponentClass<any>, pickerType
return (
<ConfigConsumer>
{({ getPrefixCls }: ConfigConsumerProps) => {
{({ getPrefixCls, getPopupContainer: getContextPopupContainer }: ConfigConsumerProps) => {
const {
prefixCls: customizePrefixCls,
inputPrefixCls: customizeInputPrefixCls,
getCalendarContainer,
size,
disabled,
} = this.props;
const getPopupContainer = getCalendarContainer || getContextPopupContainer;
const prefixCls = getPrefixCls('calendar', customizePrefixCls);
const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
const pickerClass = classNames(`${prefixCls}-picker`, {
@ -170,6 +172,7 @@ export default function wrapPicker(Picker: React.ComponentClass<any>, pickerType
return (
<Picker
{...this.props}
getCalendarContainer={getPopupContainer}
format={mergedFormat}
ref={this.savePicker}
pickerClass={pickerClass}