(ev: UIEvent)
| 643 | } |
| 644 | |
| 645 | private async openPopover(ev: UIEvent) { |
| 646 | const { fill, labelPlacement } = this; |
| 647 | const interfaceOptions = this.interfaceOptions; |
| 648 | const mode = getIonMode(this); |
| 649 | const showBackdrop = mode === 'md' ? false : true; |
| 650 | const multiple = this.multiple; |
| 651 | const value = this.value; |
| 652 | |
| 653 | let event: Event | CustomEvent = ev; |
| 654 | let size = 'auto'; |
| 655 | |
| 656 | const hasFloatingOrStackedLabel = labelPlacement === 'floating' || labelPlacement === 'stacked'; |
| 657 | /** |
| 658 | * The popover should take up the full width |
| 659 | * when using a fill in MD mode or if the |
| 660 | * label is floating/stacked. |
| 661 | */ |
| 662 | if (hasFloatingOrStackedLabel || (mode === 'md' && fill !== undefined)) { |
| 663 | size = 'cover'; |
| 664 | |
| 665 | /** |
| 666 | * Otherwise the popover |
| 667 | * should be positioned relative |
| 668 | * to the native element. |
| 669 | */ |
| 670 | } else { |
| 671 | event = { |
| 672 | ...ev, |
| 673 | detail: { |
| 674 | ionShadowTarget: this.nativeWrapperEl, |
| 675 | }, |
| 676 | }; |
| 677 | } |
| 678 | |
| 679 | const popoverOpts: PopoverOptions = { |
| 680 | mode, |
| 681 | event, |
| 682 | alignment: 'center', |
| 683 | size, |
| 684 | showBackdrop, |
| 685 | ...interfaceOptions, |
| 686 | |
| 687 | component: 'ion-select-popover', |
| 688 | cssClass: ['select-popover', interfaceOptions.cssClass], |
| 689 | componentProps: { |
| 690 | header: interfaceOptions.header, |
| 691 | subHeader: interfaceOptions.subHeader, |
| 692 | message: interfaceOptions.message, |
| 693 | multiple, |
| 694 | value, |
| 695 | options: this.createOverlaySelectOptions(this.childOpts, value), |
| 696 | }, |
| 697 | }; |
| 698 | |
| 699 | /** |
| 700 | * Workaround for Stencil to autodefine |
| 701 | * ion-select-popover and ion-popover when |
| 702 | * using Custom Elements build. |
no test coverage detected