Merge pull request #1773 from merraysy/merraysy-timepicker-dismiss-issue
Fix TimePicker dismiss issueold
commit
7f64a43246
|
@ -59,8 +59,6 @@ const factory = (Tab, TabContent, FontIcon) => {
|
|||
if (index !== prevIndex || children !== prevChildren) {
|
||||
this.updatePointer(index);
|
||||
}
|
||||
|
||||
this.updateArrows();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
|
@ -107,18 +105,13 @@ const factory = (Tab, TabContent, FontIcon) => {
|
|||
const scrollLeft = this.navigationNode.scrollLeft;
|
||||
const nav = this.navigationNode.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({
|
||||
arrows: {
|
||||
left,
|
||||
right,
|
||||
},
|
||||
});
|
||||
}
|
||||
this.setState({
|
||||
arrows: {
|
||||
left: scrollLeft > 0,
|
||||
right: nav.right < (lastLabel.right - 5),
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -117,8 +117,8 @@ const factory = (TimePickerDialog, Input) => {
|
|||
name={this.props.name}
|
||||
okLabel={okLabel}
|
||||
onDismiss={this.handleDismiss}
|
||||
onEscKeyDown={onEscKeyDown}
|
||||
onOverlayClick={onOverlayClick}
|
||||
onEscKeyDown={onEscKeyDown || this.handleDismiss}
|
||||
onOverlayClick={onOverlayClick || this.handleDismiss}
|
||||
onSelect={this.handleSelect}
|
||||
theme={this.props.theme}
|
||||
value={this.props.value}
|
||||
|
|
Loading…
Reference in New Issue