fix(all): component reusage (#18963)

Use new stencil APIs to allow ionic elements to be reused once removed from the DOM.

fixes #18843
fixes #17344
fixes #16453
fixes #15879
fixes #15788
fixes #15484
fixes #17890
fixes #16364
This commit is contained in:
Manu MA
2019-08-27 16:29:37 +02:00
committed by GitHub
parent a65d897214
commit 48a27636c7
33 changed files with 411 additions and 368 deletions

View File

@ -1,4 +1,4 @@
import { Component, ComponentInterface, Element, Host, h } from '@stencil/core';
import { Build, Component, ComponentInterface, Element, Host, h } from '@stencil/core';
import { config } from '../../global/config';
import { getIonMode } from '../../global/ionic-global';
@ -14,23 +14,24 @@ export class App implements ComponentInterface {
@Element() el!: HTMLElement;
componentDidLoad() {
rIC(() => {
const isHybrid = isPlatform(window, 'hybrid');
if (!config.getBoolean('_testing')) {
import('../../utils/tap-click').then(module => module.startTapClick(config));
}
if (config.getBoolean('statusTap', isHybrid)) {
import('../../utils/status-tap').then(module => module.startStatusTap());
}
if (config.getBoolean('inputShims', needInputShims())) {
import('../../utils/input-shims/input-shims').then(module => module.startInputShims(config));
}
if (config.getBoolean('hardwareBackButton', isHybrid)) {
import('../../utils/hardware-back-button').then(module => module.startHardwareBackButton());
}
import('../../utils/focus-visible').then(module => module.startFocusVisible());
});
if (Build.isBrowser) {
rIC(() => {
const isHybrid = isPlatform(window, 'hybrid');
if (!config.getBoolean('_testing')) {
import('../../utils/tap-click').then(module => module.startTapClick(config));
}
if (config.getBoolean('statusTap', isHybrid)) {
import('../../utils/status-tap').then(module => module.startStatusTap());
}
if (config.getBoolean('inputShims', needInputShims())) {
import('../../utils/input-shims/input-shims').then(module => module.startInputShims(config));
}
if (config.getBoolean('hardwareBackButton', isHybrid)) {
import('../../utils/hardware-back-button').then(module => module.startHardwareBackButton());
}
import('../../utils/focus-visible').then(module => module.startFocusVisible());
});
}
}
render() {