Skip to content

Commit 6ed4522

Browse files
committed
fix(MdApp): fix reveal scroll not being updated
1 parent e6dc6b5 commit 6ed4522

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

src/components/MdApp/MdApp.vue

-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
.md-app-toolbar {
8989
position: fixed;
9090
top: 0;
91-
transition: none;
9291
}
9392
}
9493
}

src/components/MdApp/MdAppMixin.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default {
3131
},
3232
data: () => ({
3333
revealTimer: null,
34-
revealLastPos: false,
34+
revealLastPos: 0,
3535
MdApp: {
3636
options: {
3737
mode: null,
@@ -116,15 +116,13 @@ export default {
116116
this.revealLastPos = scrollTop
117117
}, 100)
118118

119-
if (this.revealLastPos > scrollTop + safeAmount) {
120-
this.MdApp.toolbar.revealActive = true
121-
this.MdApp.toolbar.transformY = scrollTop - threshold
122-
} else if (scrollTop < threshold) {
123-
this.MdApp.toolbar.revealActive = false
124-
this.MdApp.toolbar.transformY = 0
119+
if (scrollTop > threshold) {
120+
this.MdApp.toolbar.revealActive = this.revealLastPos > scrollTop + safeAmount
125121
} else {
126-
this.MdApp.toolbar.transformY = scrollTop - threshold
122+
this.MdApp.toolbar.revealActive = true
127123
}
124+
125+
this.MdApp.toolbar.transformY = scrollTop - threshold
128126
},
129127
handleModeScroll ($event) {
130128
if (this.mdMode === 'reveal') {

src/components/MdApp/MdAppToolbar.vue

+7-5
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@
3434
box-shadow: none !important;
3535
}
3636
37-
.md-reveal .md-reveal-active {
38-
transform: translate3d(0, calc(100% + 10px), 0);
39-
transition: .3s $md-transition-stand-timing;
40-
transition-property: box-shadow, transform;
41-
will-change: box-shadow, transform;
37+
.md-reveal {
38+
.md-reveal-active {
39+
transform: translate3d(0, calc(100% + 10px), 0);
40+
transition: .3s $md-transition-stand-timing;
41+
transition-property: box-shadow, transform;
42+
will-change: box-shadow, transform;
43+
}
4244
}
4345
</style>

0 commit comments

Comments
 (0)