Skip to content

Commit

Permalink
Merge pull request #15156 from ant-design/date-picker-popup
Browse files Browse the repository at this point in the history
fix configProvider getPopupContainer not work with DatePicker
  • Loading branch information
afc163 committed Mar 4, 2019
2 parents 42f5aea + 0af6bde commit 19d916f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/date-picker/wrapPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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`, {
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 19d916f

Please sign in to comment.