chore(api): internal updates required for stencil 2 upgrade (#21889)

Stencil 2 is removing deprecated APIs, and these are the remaining ones Ionic has been using.
This commit is contained in:
Adam Bradley
2020-08-06 10:33:22 -05:00
committed by GitHub
parent 03c2f16e46
commit ae47d77710
10 changed files with 22 additions and 17 deletions

View File

@ -77,9 +77,14 @@ export class TabButton implements ComponentInterface, AnchorInterface {
*/
@Event() ionTabButtonClick!: EventEmitter<TabButtonClickEventDetail>;
@Listen('ionTabBarChanged', { target: 'parent' })
@Listen('ionTabBarChanged', { target: 'window' })
onTabBarChanged(ev: CustomEvent<TabBarChangedEventDetail>) {
this.selected = this.tab === ev.detail.tab;
const dispatchedFrom = ev.target as HTMLElement;
const parent = this.el.parentElement as EventTarget;
if ((ev.composedPath && ev.composedPath().includes(parent)) || dispatchedFrom && dispatchedFrom.contains(this.el)) {
this.selected = this.tab === ev.detail.tab;
}
}
componentWillLoad() {