fix(select): popover is full width when used with floating/stacked labels (#26907)

resolves #26903
This commit is contained in:
Liam DeBeasi
2023-03-06 10:49:13 -05:00
committed by GitHub
parent 98874b1a39
commit 7bc22f2bbf
2 changed files with 109 additions and 3 deletions

View File

@ -453,7 +453,7 @@ export class Select implements ComponentInterface {
}
private async openPopover(ev: UIEvent) {
const { fill } = this;
const { fill, labelPlacement } = this;
const interfaceOptions = this.interfaceOptions;
const mode = getIonMode(this);
const showBackdrop = mode === 'md' ? false : true;
@ -479,11 +479,13 @@ export class Select implements ComponentInterface {
size = 'cover';
}
} else {
const hasFloatingOrStackedLabel = labelPlacement === 'floating' || labelPlacement === 'stacked';
/**
* The popover should take up the full width
* when using a fill in MD mode.
* when using a fill in MD mode or if the
* label is floating/stacked.
*/
if (mode === 'md' && fill !== undefined) {
if (hasFloatingOrStackedLabel || (mode === 'md' && fill !== undefined)) {
size = 'cover';
/**