Skip to content

Commit e8f40ad

Browse files
committed
findDOMNode not neccesary
1 parent 87f7333 commit e8f40ad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/DateTimeField.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ export default class DateTimeField extends Component {
263263
this.setState({
264264
showPicker: true
265265
});
266-
gBCR = findDOMNode(this.refs.dtpbutton).getBoundingClientRect();
266+
gBCR = this.refs.dtpbutton.getBoundingClientRect();
267267
classes = {
268268
"bootstrap-datetimepicker-widget": true,
269269
"dropdown-menu": true
@@ -272,11 +272,11 @@ export default class DateTimeField extends Component {
272272
top: gBCR.top + window.pageYOffset - document.documentElement.clientTop,
273273
left: gBCR.left + window.pageXOffset - document.documentElement.clientLeft
274274
};
275-
offset.top = offset.top + findDOMNode(this.refs.datetimepicker).offsetHeight;
275+
offset.top = offset.top + this.refs.datetimepicker.offsetHeight;
276276
scrollTop = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
277-
placePosition = this.props.direction === "up" ? "top" : this.props.direction === "bottom" ? "bottom" : this.props.direction === "auto" ? offset.top + findDOMNode(this.refs.widget).offsetHeight > window.offsetHeight + scrollTop && this.refs.widget.offsetHeight + findDOMNode(this.refs.datetimepicker).offsetHeight > offset.top ? "top" : "bottom" : void 0;
277+
placePosition = this.props.direction === "up" ? "top" : this.props.direction === "bottom" ? "bottom" : this.props.direction === "auto" ? offset.top + this.refs.widget.offsetHeight > window.offsetHeight + scrollTop && this.refs.widget.offsetHeight + this.refs.datetimepicker.offsetHeight > offset.top ? "top" : "bottom" : void 0;
278278
if (placePosition === "top") {
279-
offset.top = -findDOMNode(this.refs.widget).offsetHeight - findDOMNode(this).clientHeight - 2;
279+
offset.top = -this.refs.widget.offsetHeight - this.clientHeight - 2;
280280
classes.top = true;
281281
classes.bottom = false;
282282
classes["pull-right"] = true;

0 commit comments

Comments
 (0)