Skip to content

Commit 4a6265c

Browse files
committed
findDOMNode instead of getDOMNode
1 parent 83c8bdc commit 4a6265c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/DateTimeField.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { Component, PropTypes } from "react";
2+
import {findDOMNode} from "react-dom";
23
import moment from "moment";
34
import { Glyphicon } from "react-bootstrap";
45
import DateTimePicker from "./DateTimePicker.js";
@@ -262,7 +263,7 @@ export default class DateTimeField extends Component {
262263
this.setState({
263264
showPicker: true
264265
});
265-
gBCR = this.refs.dtpbutton.getDOMNode().getBoundingClientRect();
266+
gBCR = findDOMNode(this.refs.dtpbutton).getBoundingClientRect();
266267
classes = {
267268
"bootstrap-datetimepicker-widget": true,
268269
"dropdown-menu": true
@@ -271,7 +272,7 @@ export default class DateTimeField extends Component {
271272
top: gBCR.top + window.pageYOffset - document.documentElement.clientTop,
272273
left: gBCR.left + window.pageXOffset - document.documentElement.clientLeft
273274
};
274-
offset.top = offset.top + this.refs.datetimepicker.getDOMNode().offsetHeight;
275+
offset.top = offset.top + findDOMNode(this.refs.datetimepicker).offsetHeight;
275276
scrollTop = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
276277
placePosition = this.props.direction === "up" ? "top" : this.props.direction === "bottom" ? "bottom" : this.props.direction === "auto" ? offset.top + this.refs.widget.getDOMNode().offsetHeight > window.offsetHeight + scrollTop && this.refs.widget.offsetHeight + this.refs.datetimepicker.getDOMNode().offsetHeight > offset.top ? "top" : "bottom" : void 0;
277278
if (placePosition === "top") {

0 commit comments

Comments
 (0)