Skip to content

Commit

Permalink
fix(side-bar): example abnormal (#2325)
Browse files Browse the repository at this point in the history
* fix(side-bar): example abnormal

* test: snap-update

* test(dropdown-menu): snap-update

* test: update snapshot

---------

Co-authored-by: leejimqiu <leejimqiu@gmail.com>
  • Loading branch information
betavs and LeeJim authored Aug 29, 2023
1 parent c16b567 commit 56b5517
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/side-bar/__test__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,7 @@ exports[`SideBar SideBar switch demo works fine 1`] = `
>
<wx-scroll-view
class="section"
scrollTop="{{0}}"
scrollWithAnimation="{{true}}"
scrollY="{{true}}"
showScrollbar="{{false}}"
Expand Down Expand Up @@ -1230,6 +1231,7 @@ exports[`SideBar SideBar switch demo works fine 1`] = `
</wx-scroll-view>
<wx-scroll-view
class="section"
scrollTop="{{0}}"
scrollWithAnimation="{{true}}"
scrollY="{{true}}"
showScrollbar="{{false}}"
Expand Down Expand Up @@ -1354,6 +1356,7 @@ exports[`SideBar SideBar switch demo works fine 1`] = `
</wx-scroll-view>
<wx-scroll-view
class="section"
scrollTop="{{0}}"
scrollWithAnimation="{{true}}"
scrollY="{{true}}"
showScrollbar="{{false}}"
Expand Down Expand Up @@ -1434,6 +1437,7 @@ exports[`SideBar SideBar switch demo works fine 1`] = `
</wx-scroll-view>
<wx-scroll-view
class="section"
scrollTop="{{0}}"
scrollWithAnimation="{{true}}"
scrollY="{{true}}"
showScrollbar="{{false}}"
Expand Down Expand Up @@ -1536,6 +1540,7 @@ exports[`SideBar SideBar switch demo works fine 1`] = `
</wx-scroll-view>
<wx-scroll-view
class="section"
scrollTop="{{0}}"
scrollWithAnimation="{{true}}"
scrollY="{{true}}"
showScrollbar="{{false}}"
Expand Down
2 changes: 1 addition & 1 deletion src/side-bar/_example/switch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ Page({
onSideBarChange(e) {
const { value } = e.detail;

this.setData({ sideBarIndex: value });
this.setData({ sideBarIndex: value, scrollTop: 0 });
},
});
1 change: 1 addition & 0 deletions src/side-bar/_example/switch/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
wx:key="index"
class="section"
scroll-y
scroll-top="{{scrollTop}}"
scroll-with-animation
show-scrollbar="{{false}}"
>
Expand Down

0 comments on commit 56b5517

Please sign in to comment.