Skip to content

Commit

Permalink
fix(popup): fix UIWebView popup bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Петренков Артем Валерьевич committed Jul 24, 2017
1 parent 7059dfd commit b74a4be
Show file tree
Hide file tree
Showing 4 changed files with 167 additions and 70 deletions.
5 changes: 5 additions & 0 deletions src/popup/fantasy/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@
flex-direction: column;
border-radius: 0;
}

.popup__content {
/* чтобы контент с position:relative в UIWebView не исчезал при быстром скролле */
transform: translateZ(0);
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/popup/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@
flex-direction: column;
height: 100%;
}

.popup__content {
/* чтобы контент с position:relative в UIWebView не исчезал при быстром скролле */
transform: translateZ(0);
}
}
}

Expand Down
10 changes: 10 additions & 0 deletions src/select/select.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ class Select extends React.Component {
className={ cn('mobile-header') }
size={ this.props.size }
title={ this.props.mobileTitle || this.props.placeholder }
onCloseClick={ this.handlePopupCloseClick }
/>
);
}
Expand Down Expand Up @@ -653,6 +654,13 @@ class Select extends React.Component {
this.setState({ isMobile: isMatched });
}

@autobind
handlePopupCloseClick() {
this.setState({
opened: false
});
}

/**
* Устанавливает фокус на компонент.
*
Expand Down Expand Up @@ -697,6 +705,8 @@ class Select extends React.Component {
}

focusOnMenu() {
if (this.state.isMobile && this.props.mobileMenuMode === 'popup') return;

let scrollContainer = this.getScrollContainer();

let posX = scrollContainer.scrollTop;
Expand Down
Loading

0 comments on commit b74a4be

Please sign in to comment.