parent
4347125901
commit
286c3f792e
|
@ -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,
|
},
|
||||||
},
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue