From 8fbd11015c55253002b6e31419dcd49a96e0d2b6 Mon Sep 17 00:00:00 2001 From: yiminghe Date: Wed, 11 Nov 2015 12:26:26 +0800 Subject: [PATCH] fix datepicker in modal. Fixes #505 #506 --- components/datepicker/demo/dialog.md | 45 +++++++++++++++++++++++++ style/components/datepicker/Picker.less | 5 +-- 2 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 components/datepicker/demo/dialog.md diff --git a/components/datepicker/demo/dialog.md b/components/datepicker/demo/dialog.md new file mode 100644 index 0000000000..7a14b53695 --- /dev/null +++ b/components/datepicker/demo/dialog.md @@ -0,0 +1,45 @@ +# 结合弹出层 + +- order: 10 + +弹出层内的时间选择 + +--- + +````jsx +import { Modal, Button, Datepicker } from 'antd'; + +const App = React.createClass({ + getInitialState() { + return { visible: false }; + }, + showModal() { + this.setState({ + visible: true + }); + }, + handleOk() { + console.log('点击了确定'); + this.setState({ + visible: false + }); + }, + handleCancel() { + this.setState({ + visible: false + }); + }, + render() { + return
+ + + + +
; + } +}); + +ReactDOM.render( , document.getElementById('components-datepicker-demo-dialog')); +```` + diff --git a/style/components/datepicker/Picker.less b/style/components/datepicker/Picker.less index 8b36f150e1..f14248c970 100644 --- a/style/components/datepicker/Picker.less +++ b/style/components/datepicker/Picker.less @@ -1,9 +1,6 @@ .@{calendar-prefix-cls}-picker-container { position: absolute; - .@{calendar-prefix-cls} { - position: absolute; - z-index: 1070; - } + z-index: 1070; } .@{calendar-prefix-cls}-picker {