mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-13 11:38:31 +08:00
fix(prefs): Only scroll to top when switching tabs
This commit is contained in:
parent
596777a427
commit
d214a52192
2 changed files with 9 additions and 5 deletions
|
@ -28,10 +28,12 @@ class PreferencesRoot extends React.Component {
|
||||||
this._focusContent();
|
this._focusContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate() {
|
componentDidUpdate(oldProps) {
|
||||||
const scrollRegion = document.querySelector(".preferences-content .scroll-region-content");
|
if (oldProps.tab !== this.props.tab) {
|
||||||
scrollRegion.scrollTop = 0;
|
const scrollRegion = document.querySelector(".preferences-content .scroll-region-content");
|
||||||
this._focusContent();
|
scrollRegion.scrollTop = 0;
|
||||||
|
this._focusContent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_localHandlers() {
|
_localHandlers() {
|
||||||
|
|
|
@ -19,7 +19,9 @@ class PreferencesAccounts extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
this.unsubscribe();
|
if (this.unsubscribe) {
|
||||||
|
this.unsubscribe();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getStateFromStores({selected} = {}) {
|
getStateFromStores({selected} = {}) {
|
||||||
|
|
Loading…
Reference in a new issue