File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,10 @@ export const AppScrollEffectsBehavior = [
227227 return Math . max ( 0 , this . _scrollTop ) ;
228228 } ,
229229
230+ attached : function ( ) {
231+ this . _scrollStateChanged ( ) ;
232+ } ,
233+
230234 detached : function ( ) {
231235 this . _tearDownEffects ( ) ;
232236 } ,
@@ -368,6 +372,10 @@ export const AppScrollEffectsBehavior = [
368372 * Overrides the `_scrollHandler`.
369373 */
370374 _scrollHandler : function ( ) {
375+ this . _scrollStateChanged ( ) ;
376+ } ,
377+
378+ _scrollStateChanged : function ( ) {
371379 if ( ! this . disabled ) {
372380 var scrollTop = this . _clampedScrollTop ;
373381 this . _updateScrollState ( scrollTop ) ;
Original file line number Diff line number Diff line change 225225 ] ) ;
226226 } ) ;
227227 } ) ;
228+
229+ test ( 'reset threshold-triggered on attached (#570)' , function ( done ) {
230+ flush ( function ( ) {
231+ var parent = container . parentElement ;
232+ assert . isUndefined ( container . thresholdTriggered ) ;
233+ assert . equal ( container . threshold , 0 ) ;
234+ container . threshold = 100 ;
235+
236+ scrollTestHelper ( container . scrollTarget , [
237+ {
238+ y : 100 ,
239+ callback : function ( ) {
240+ assert . isTrue ( container . thresholdTriggered ) ;
241+ parent . removeChild ( container ) ;
242+ assert . isTrue ( container . thresholdTriggered ) ;
243+ }
244+ } ,
245+ {
246+ y : 0 ,
247+ callback : function ( ) {
248+ assert . isTrue ( container . thresholdTriggered ) ;
249+ parent . appendChild ( container ) ;
250+ assert . isFalse ( container . thresholdTriggered ) ;
251+ done ( ) ;
252+ }
253+ }
254+ ] ) ;
255+ } ) ;
256+ } ) ;
228257 } ) ;
229258 </ script >
230259
You can’t perform that action at this time.
0 commit comments