mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 11:41:20 +08:00
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:
@ -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() {
|
||||
|
Reference in New Issue
Block a user