@@ -74,26 +74,6 @@ export class UUIPopoverContainerElement extends LitElement {
74
74
this . removeEventListener ( 'beforetoggle' , this . #onBeforeToggle) ;
75
75
}
76
76
77
- #updatePadding = ( ) => {
78
- const oppositeSides : Record < string , string > = {
79
- top : 'bottom' ,
80
- bottom : 'top' ,
81
- left : 'right' ,
82
- right : 'left' ,
83
- } ;
84
-
85
- // find the side excluding start/end
86
- let side = this . _actualPlacement . split ( '-' ) [ 0 ] ;
87
- // find the opposite side
88
- side = oppositeSides [ side ] || side ;
89
- // capitalize the side
90
- side = side . charAt ( 0 ) . toUpperCase ( ) + side . slice ( 1 ) ;
91
-
92
- const paddingSide = `padding${ side } ` ;
93
- this . style . padding = '0' ;
94
- ( this . style as any ) [ paddingSide ] = `10px` ;
95
- } ;
96
-
97
77
#onBeforeToggle = async ( event : any ) => {
98
78
this . #targetElement = this . #findAncestorWithAttribute(
99
79
this ,
@@ -273,6 +253,26 @@ export class UUIPopoverContainerElement extends LitElement {
273
253
this . style . opacity = '1' ;
274
254
} ;
275
255
256
+ #updatePadding = ( ) => {
257
+ const oppositeSides : Record < string , string > = {
258
+ top : 'bottom' ,
259
+ bottom : 'top' ,
260
+ left : 'right' ,
261
+ right : 'left' ,
262
+ } ;
263
+
264
+ // find the side excluding start/end
265
+ let side = this . _actualPlacement . split ( '-' ) [ 0 ] ;
266
+ // find the opposite side
267
+ side = oppositeSides [ side ] || side ;
268
+ // capitalize the side
269
+ side = side . charAt ( 0 ) . toUpperCase ( ) + side . slice ( 1 ) ;
270
+
271
+ const paddingSide = `padding${ side } ` ;
272
+ this . style . padding = '0' ;
273
+ ( this . style as any ) [ paddingSide ] = `${ this . margin } px` ;
274
+ } ;
275
+
276
276
#flipPlacement( ) {
277
277
const [ direction , position ] = this . _actualPlacement . split ( '-' ) ;
278
278
const oppositeDirection =
0 commit comments