@@ -42,6 +42,8 @@ export class DDResizable extends DDBaseImplement implements HTMLElementExtendOpt
4242 /** @internal */
4343 private scrolled : number ;
4444 /** @internal */
45+ private scrollEl : HTMLElement ;
46+ /** @internal */
4547 private startEvent : MouseEvent ;
4648 /** @internal value saved in the same order as _originStyleProp[] */
4749 private elOriginStyleVal : string [ ] ;
@@ -157,8 +159,8 @@ export class DDResizable extends DDBaseImplement implements HTMLElementExtendOpt
157159 /** @internal */
158160 private _resizeStart ( event : MouseEvent ) : DDResizable {
159161 this . originalRect = this . el . getBoundingClientRect ( ) ;
160- const scrollEl = Utils . getScrollParent ( this . el ) ;
161- this . scrollY = scrollEl ? scrollEl . scrollTop : 0 ;
162+ this . scrollEl = Utils . getScrollParent ( this . el ) ;
163+ this . scrollY = this . scrollEl . scrollTop ;
162164 this . startEvent = event ;
163165 this . _setupHelper ( ) ;
164166 this . _applyChange ( ) ;
@@ -173,8 +175,7 @@ export class DDResizable extends DDBaseImplement implements HTMLElementExtendOpt
173175
174176 /** @internal */
175177 private _resizing ( event : MouseEvent , dir : string ) : DDResizable {
176- const scrollEl = Utils . getScrollParent ( this . el ) ;
177- this . scrolled = scrollEl ? ( scrollEl . scrollTop - this . scrollY ) : this . scrollY ;
178+ this . scrolled = this . scrollEl . scrollTop - this . scrollY ;
178179 this . temporalRect = this . _getChange ( event , dir ) ;
179180 this . _applyChange ( ) ;
180181 const ev = DDUtils . initEvent < MouseEvent > ( event , { type : 'resize' , target : this . el } ) ;
@@ -303,7 +304,8 @@ export class DDResizable extends DDBaseImplement implements HTMLElementExtendOpt
303304
304305 /** @internal */
305306 private _ui = ( ) : DDUIData => {
306- const containmentRect = this . el . parentElement . getBoundingClientRect ( ) ;
307+ const containmentEl = this . el . parentElement ;
308+ const containmentRect = containmentEl . getBoundingClientRect ( ) ;
307309 const newRect = { // Note: originalRect is a complex object, not a simple Rect, so copy out.
308310 width : this . originalRect . width ,
309311 height : this . originalRect . height + this . scrolled ,
0 commit comments