diff --git a/CHANGELOG.md b/CHANGELOG.md
index a624350a54..4a28b2a42c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -132,6 +132,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- [\#1667](https://github.com/cosmos/voyager/issues/1667) Fixed menu in PageSend + hover cursor for menu @sabau
- [\#1676](https://github.com/cosmos/voyager/issues/1676) Reduced minWidth css for ModalVote to have 2 buttons per line @sabau
- [\#1676](https://github.com/cosmos/voyager/issues/1670) Update balance in header after voting and depositing @faboweb
+- [\#1572](https://github.com/cosmos/voyager/issues/1572) Fixed scroll bug when switching between tabs @jbibla
## [0.10.7] - 2018-10-10
diff --git a/app/src/renderer/components/governance/PageGovernance.vue b/app/src/renderer/components/governance/PageGovernance.vue
index b79c9335f2..d0ad1f6af6 100644
--- a/app/src/renderer/components/governance/PageGovernance.vue
+++ b/app/src/renderer/components/governance/PageGovernance.vue
@@ -31,6 +31,7 @@
import { mapGetters } from "vuex"
import DataEmptySearch from "common/TmDataEmptySearch"
import ModalSearch from "common/TmModalSearch"
+import PerfectScrollbar from "perfect-scrollbar"
import ModalPropose from "./ModalPropose"
import ToolBar from "common/ToolBar"
import TmBalance from "common/TmBalance"
@@ -66,6 +67,12 @@ export default {
// TODO: get min deposit denom from gov params
...mapGetters([`proposals`, `filters`, `bondingDenom`, `connected`])
},
+ mounted() {
+ this.ps = new PerfectScrollbar(this.$el.querySelector(`.tm-page-main`))
+ },
+ updated() {
+ this.$el.querySelector(`.tm-page-main`).scrollTop = 0
+ },
methods: {
onPropose() {
this.showModalPropose = true
diff --git a/app/src/renderer/components/staking/PageStaking.vue b/app/src/renderer/components/staking/PageStaking.vue
index 60dabaea83..66743b0921 100644
--- a/app/src/renderer/components/staking/PageStaking.vue
+++ b/app/src/renderer/components/staking/PageStaking.vue
@@ -23,6 +23,7 @@ import { mapGetters, mapActions } from "vuex"
import Mousetrap from "mousetrap"
import { TmPage } from "@tendermint/ui"
import ModalSearch from "common/TmModalSearch"
+import PerfectScrollbar from "perfect-scrollbar"
import ToolBar from "common/ToolBar"
import TmBalance from "common/TmBalance"
export default {
@@ -53,13 +54,18 @@ export default {
computed: {
...mapGetters([`connected`, `delegates`, `filters`])
},
- async mounted() {
+ mounted() {
+ this.ps = new PerfectScrollbar(this.$el.querySelector(`.tm-page-main`))
+
Mousetrap.bind([`command+f`, `ctrl+f`], () => this.setSearch(true))
Mousetrap.bind(`esc`, () => this.setSearch(false))
// XXX temporary because querying the shares shows old shares after bonding
// this.updateDelegates()
},
+ updated() {
+ this.$el.querySelector(`.tm-page-main`).scrollTop = 0
+ },
methods: {
setSearch(bool = !this.filters[`delegates`].search.visible) {
this.$store.commit(`setSearchVisible`, [`delegates`, bool])
diff --git a/test/unit/specs/components/governance/__snapshots__/PageGovernance.spec.js.snap b/test/unit/specs/components/governance/__snapshots__/PageGovernance.spec.js.snap
index 480cd7bd27..ed0aa98f28 100644
--- a/test/unit/specs/components/governance/__snapshots__/PageGovernance.spec.js.snap
+++ b/test/unit/specs/components/governance/__snapshots__/PageGovernance.spec.js.snap
@@ -61,7 +61,7 @@ exports[`PageGovernance disables proposal creation if not connected 1`] = `
-