Skip to content

Commit bb66530

Browse files
committed
perf: improve app toolbar performance on scroll
1 parent 20dbc0b commit bb66530

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/components/MdApp/MdApp.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
transform: translate3d(0, 0, 0);
8888
8989
.md-app-toolbar {
90-
position: fixed;
90+
position: absolute;
9191
top: 0;
9292
}
9393
}

src/components/MdApp/MdAppMixin.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import raf from 'raf'
12
import MdPropValidator from 'core/utils/MdPropValidator'
23

34
const mdAppModes = [
@@ -23,6 +24,7 @@ export default {
2324
data: () => ({
2425
revealTimer: null,
2526
revealLastPos: 0,
27+
manualTick: false,
2628
MdApp: {
2729
options: {
2830
mode: null,
@@ -242,7 +244,7 @@ export default {
242244
},
243245
handleScroll ($event) {
244246
if (this.MdApp.toolbar.element) {
245-
window.requestAnimationFrame(() => {
247+
raf(() => {
246248
if (this.mdWaterfall) {
247249
this.handleWaterfallScroll($event)
248250
}

0 commit comments

Comments
 (0)