Merge pull request #1004 from makieno/patch-1

Dropdown auto fix
old
Javi Velasco 2016-11-30 17:05:54 +01:00 committed by GitHub
commit 03997da929
1 changed files with 3 additions and 3 deletions

View File

@ -80,7 +80,7 @@ const factory = (Input) => {
touchend: this.handleDocumentClick
});
open = () => {
open = (event) => {
const client = event.target.getBoundingClientRect();
const screenHeight = window.innerHeight || document.documentElement.offsetHeight;
const up = this.props.auto ? client.top > ((screenHeight / 2) + client.height) : false;
@ -101,7 +101,7 @@ const factory = (Input) => {
};
handleClick = (event) => {
this.open();
this.open(event);
events.pauseEvent(event);
if (this.props.onClick) this.props.onClick(event);
};
@ -162,7 +162,7 @@ const factory = (Input) => {
handleFocus = event => {
event.stopPropagation();
if (!this.props.disabled) this.open();
if (!this.props.disabled) this.open(event);
if (this.props.onFocus) this.props.onFocus(event);
};