File tree Expand file tree Collapse file tree 4 files changed +18
-8
lines changed
Expand file tree Collapse file tree 4 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,10 @@ export default class IgcResizeContainerComponent extends EventEmitterMixin<
9494 return this . _mode ;
9595 }
9696
97+ public setSize ( width : number , height : number ) : void {
98+ this . _controller . setSize ( width , height ) ;
99+ }
100+
97101 constructor ( ) {
98102 super ( ) ;
99103
Original file line number Diff line number Diff line change @@ -72,6 +72,16 @@ class ResizeController implements ReactiveController {
7272 this . _activeRef = null ;
7373 }
7474
75+ /** Assign the given width and height in pixels to the resize target of the controller. */
76+ public setSize ( width : number , height : number ) : void {
77+ if ( this . _resizeTarget ) {
78+ Object . assign ( this . _resizeTarget . style , {
79+ width : `${ width } px` ,
80+ height : `${ height } px` ,
81+ } ) ;
82+ }
83+ }
84+
7585 /** @internal */
7686 public hostConnected ( ) : void {
7787 this . _host . addEventListener ( 'pointerdown' , this ) ;
@@ -144,9 +154,7 @@ class ResizeController implements ReactiveController {
144154 this . _options . end ?. call ( this . _host , parameters ) ;
145155 this . _state . current = parameters . state . current ;
146156
147- parameters . state . commit ?. call ( this . _host ) ??
148- this . _updatePosition ( this . _resizeTarget ) ;
149-
157+ this . _updatePosition ( this . _resizeTarget ) ;
150158 this . dispose ( ) ;
151159 }
152160
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ export type ResizeState = {
1212 deltaY : number ;
1313 ghost : HTMLElement | null ;
1414 trigger : HTMLElement | null ;
15- commit ?: ( ) => unknown ;
1615} ;
1716
1817export type ResizeCallbackParams = {
Original file line number Diff line number Diff line change @@ -461,13 +461,12 @@ export default class IgcTileComponent extends EventEmitterMixin<
461461 } ) ;
462462
463463 await transition ?. finished ;
464- const updatedSize = this . _resizeState . calculateResizedSize (
464+
465+ const { width, height } = this . _resizeState . calculateResizedSize (
465466 this . _cssContainer
466467 ) ;
467468
468- state . current . width = updatedSize . width ;
469- state . current . height = updatedSize . height ;
470-
469+ this . _resizeContainer ?. setSize ( width , height ) ;
471470 this . _setResizeState ( false ) ;
472471 }
473472
You can’t perform that action at this time.
0 commit comments