Skip to content

Commit

Permalink
fix Popover position for datepicker
Browse files Browse the repository at this point in the history
  • Loading branch information
caesay committed Aug 11, 2016
1 parent 1deb0bc commit b3ed601
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/DatePicker/DatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ class DatePicker extends Component {
const hintText = keyboardEnabled && this.state.keyboardActivated ? 'yyyy-mm-dd' : this.props.hintText;

return (
<div className={className} style={prepareStyles(Object.assign({}, style))}>
<div ref="root" className={className} style={prepareStyles(Object.assign({}, style))}>
<TextField
{...other}
onFocus={this.handleInputFocus}
Expand All @@ -410,6 +410,7 @@ class DatePicker extends Component {
<DatePickerDialog
DateTimeFormat={DateTimeFormat}
autoOk={autoOk}
anchorEl={this.refs.root}
cancelLabel={cancelLabel}
container={container}
containerStyle={dialogContainerStyle}
Expand Down
4 changes: 3 additions & 1 deletion src/DatePicker/DatePickerDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {dateTimeFormat} from './dateUtils';
class DatePickerDialog extends Component {
static propTypes = {
DateTimeFormat: PropTypes.func,
anchorEl: PropTypes.object,
animation: PropTypes.func,
autoOk: PropTypes.bool,
cancelLabel: PropTypes.node,
Expand Down Expand Up @@ -103,6 +104,7 @@ class DatePickerDialog extends Component {
render() {
const {
DateTimeFormat,
anchorEl,
autoOk,
cancelLabel,
container,
Expand Down Expand Up @@ -143,7 +145,7 @@ class DatePickerDialog extends Component {
return (
<div {...other} ref="root">
<Container
anchorEl={this.refs.root} // For Popover
anchorEl={anchorEl || this.refs.root} // For Popover
animation={animation || PopoverAnimationVertical} // For Popover
bodyStyle={styles.dialogBodyContent}
contentStyle={styles.dialogContent}
Expand Down

0 comments on commit b3ed601

Please sign in to comment.