@@ -9,6 +9,7 @@ import SSRBootable from '../../mixins/ssr-bootable'
9
9
10
10
// Directives
11
11
import Scroll from '../../directives/scroll'
12
+ import { deprecate } from '../../util/console'
12
13
13
14
/* @vue /component */
14
15
export default {
@@ -49,6 +50,7 @@ export default {
49
50
manualScroll : Boolean ,
50
51
prominent : Boolean ,
51
52
scrollOffScreen : Boolean ,
53
+ /* @deprecated */
52
54
scrollToolbarOffScreen : Boolean ,
53
55
scrollTarget : String ,
54
56
scrollThreshold : {
@@ -77,6 +79,16 @@ export default {
77
79
} ) ,
78
80
79
81
computed : {
82
+ canScroll ( ) {
83
+ // TODO: remove
84
+ if ( this . scrollToolbarOffScreen ) {
85
+ deprecate ( 'scrollToolbarOffScreen' , 'scrollOffScreen' , this )
86
+
87
+ return true
88
+ }
89
+
90
+ return this . scrollOffScreen || this . invertedScroll
91
+ } ,
80
92
computedContentHeight ( ) {
81
93
if ( this . height ) return parseInt ( this . height )
82
94
if ( this . dense ) return this . heights . dense
@@ -112,7 +124,7 @@ export default {
112
124
'v-toolbar' : true ,
113
125
'elevation-0' : this . flat || ( ! this . isActive &&
114
126
! this . tabs &&
115
- ! this . scrollToolbarOffScreen
127
+ this . canScroll
116
128
) ,
117
129
'v-toolbar--absolute' : this . absolute ,
118
130
'v-toolbar--card' : this . card ,
@@ -138,7 +150,7 @@ export default {
138
150
} ,
139
151
computedTransform ( ) {
140
152
return ! this . isActive
141
- ? this . scrollToolbarOffScreen
153
+ ? this . canScroll
142
154
? - this . computedContentHeight
143
155
: - this . computedHeight
144
156
: 0
@@ -197,8 +209,7 @@ export default {
197
209
198
210
methods : {
199
211
onScroll ( ) {
200
- if ( ( ! this . scrollOffScreen &&
201
- ! this . scrollToolbarOffScreen ) ||
212
+ if ( ! this . canScroll ||
202
213
this . manualScroll ||
203
214
typeof window === 'undefined'
204
215
) return
0 commit comments