fix(select-rich): add workaround invoker width when inside overlay
This commit is contained in:
parent
679d189ec4
commit
9b9db3dde4
3 changed files with 14 additions and 1 deletions
5
.changeset/angry-snails-repeat.md
Normal file
5
.changeset/angry-snails-repeat.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@lion/select-rich': patch
|
||||
---
|
||||
|
||||
add workarround and todo for align select-rich invoker width with options if its inside an overlay
|
||||
|
|
@ -21,6 +21,7 @@ export class LionSelectInvoker extends LionButton {
|
|||
|
||||
#content-wrapper {
|
||||
position: relative;
|
||||
pointer-events: none;
|
||||
}
|
||||
`,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -388,7 +388,14 @@ export class LionSelectRich extends SlotMixin(ScopedElementsMixin(OverlayMixin(L
|
|||
this._overlayCtrl.content.style.minWidth = 'auto';
|
||||
this._overlayCtrl.content.style.width = 'auto';
|
||||
const contentWidth = this._overlayCtrl.content.getBoundingClientRect().width;
|
||||
this._invokerNode.style.width = `${contentWidth + this._arrowWidth}px`;
|
||||
/**
|
||||
* TODO when inside an overlay the current solution doesn't work.
|
||||
* Since that dialog is still hidden, open and close the select-rich
|
||||
* doesn't have any effect so the contentWidth returns 0
|
||||
*/
|
||||
if (contentWidth > 0) {
|
||||
this._invokerNode.style.width = `${contentWidth + this._arrowWidth}px`;
|
||||
}
|
||||
this._overlayCtrl.content.style.display = initContentDisplay;
|
||||
this._overlayCtrl.content.style.minWidth = initContentMinWidth;
|
||||
this._overlayCtrl.content.style.width = initContentWidth;
|
||||
|
|
|
|||
Loading…
Reference in a new issue