Merge pull request #1773 from merraysy/merraysy-timepicker-dismiss-issue

Fix TimePicker dismiss issue
old
Rubén Moya 2018-02-27 11:42:48 +01:00 committed by GitHub
commit 7f64a43246
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 15 deletions

View File

@ -59,8 +59,6 @@ const factory = (Tab, TabContent, FontIcon) => {
if (index !== prevIndex || children !== prevChildren) { if (index !== prevIndex || children !== prevChildren) {
this.updatePointer(index); this.updatePointer(index);
} }
this.updateArrows();
} }
componentWillUnmount() { componentWillUnmount() {
@ -107,18 +105,13 @@ const factory = (Tab, TabContent, FontIcon) => {
const scrollLeft = this.navigationNode.scrollLeft; const scrollLeft = this.navigationNode.scrollLeft;
const nav = this.navigationNode.getBoundingClientRect(); const nav = this.navigationNode.getBoundingClientRect();
const lastLabel = this.navigationNode.children[idx].getBoundingClientRect(); const lastLabel = this.navigationNode.children[idx].getBoundingClientRect();
const left = scrollLeft > 0;
const right = nav.right < (lastLabel.right - 5);
const { left: prevLeft, right: prevRight } = this.state.arrows;
if (left !== prevLeft || right !== prevRight) { this.setState({
this.setState({ arrows: {
arrows: { left: scrollLeft > 0,
left, right: nav.right < (lastLabel.right - 5),
right, },
}, });
});
}
} }
} }

View File

@ -117,8 +117,8 @@ const factory = (TimePickerDialog, Input) => {
name={this.props.name} name={this.props.name}
okLabel={okLabel} okLabel={okLabel}
onDismiss={this.handleDismiss} onDismiss={this.handleDismiss}
onEscKeyDown={onEscKeyDown} onEscKeyDown={onEscKeyDown || this.handleDismiss}
onOverlayClick={onOverlayClick} onOverlayClick={onOverlayClick || this.handleDismiss}
onSelect={this.handleSelect} onSelect={this.handleSelect}
theme={this.props.theme} theme={this.props.theme}
value={this.props.value} value={this.props.value}