fix(popover): update prop defaults, use correct delegate (#23340)

This commit is contained in:
Liam DeBeasi
2021-05-21 11:11:22 -04:00
committed by GitHub
parent a67a0fabb8
commit 960778a36f
3 changed files with 11 additions and 4 deletions

View File

@@ -824,7 +824,7 @@ ion-picker,css-prop,--min-width
ion-picker,css-prop,--width
ion-popover,shadow
ion-popover,prop,alignment,"center" | "end" | "start",'center',false,false
ion-popover,prop,alignment,"center" | "end" | "start",'start',false,false
ion-popover,prop,animated,boolean,true,false,false
ion-popover,prop,arrow,boolean,true,false,false
ion-popover,prop,backdropDismiss,boolean,true,false,false

View File

@@ -205,7 +205,7 @@ export class Popover implements ComponentInterface, OverlayInterface {
/**
* Describes how to align the popover content with the `reference` point.
*/
@Prop() alignment: PositionAlign = 'center';
@Prop() alignment: PositionAlign = 'start';
/**
* If `true`, the popover will display an arrow
@@ -437,7 +437,14 @@ export class Popover implements ComponentInterface, OverlayInterface {
destroyDismissInteraction();
this.destroyDismissInteraction = undefined;
}
await detachComponent(this.delegate, this.usersElement);
/**
* If using popover inline
* we potentially need to use the coreDelegate
* so that this works in vanilla JS apps
*/
const delegate = (this.inline) ? this.delegate || this.coreDelegate : this.delegate;
await detachComponent(delegate, this.usersElement);
}
this.currentTransition = undefined;

View File

@@ -569,7 +569,7 @@ export default defineComponent({
| Property | Attribute | Description | Type | Default |
| ----------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | ----------- |
| `alignment` | `alignment` | Describes how to align the popover content with the `reference` point. | `"center" \| "end" \| "start"` | `'center'` |
| `alignment` | `alignment` | Describes how to align the popover content with the `reference` point. | `"center" \| "end" \| "start"` | `'start'` |
| `animated` | `animated` | If `true`, the popover will animate. | `boolean` | `true` |
| `arrow` | `arrow` | If `true`, the popover will display an arrow that points at the `reference` when running in `ios` mode on mobile. Does not apply in `md` mode or on desktop. | `boolean` | `true` |
| `backdropDismiss` | `backdrop-dismiss` | If `true`, the popover will be dismissed when the backdrop is clicked. | `boolean` | `true` |