mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-13 03:29:46 +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();
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
const scrollRegion = document.querySelector(".preferences-content .scroll-region-content");
|
||||
scrollRegion.scrollTop = 0;
|
||||
this._focusContent();
|
||||
componentDidUpdate(oldProps) {
|
||||
if (oldProps.tab !== this.props.tab) {
|
||||
const scrollRegion = document.querySelector(".preferences-content .scroll-region-content");
|
||||
scrollRegion.scrollTop = 0;
|
||||
this._focusContent();
|
||||
}
|
||||
}
|
||||
|
||||
_localHandlers() {
|
||||
|
|
|
@ -19,7 +19,9 @@ class PreferencesAccounts extends React.Component {
|
|||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.unsubscribe();
|
||||
if (this.unsubscribe) {
|
||||
this.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
getStateFromStores({selected} = {}) {
|
||||
|
|
Loading…
Reference in a new issue