fix(ie): classList does not support variadic (#19460)

This commit is contained in:
Manu MA
2019-09-27 13:12:06 +02:00
committed by GitHub
parent a28e501272
commit b4d92c6241
7 changed files with 29 additions and 23 deletions

View File

@ -74,16 +74,16 @@ const getClasses = (element: HTMLElement) => {
const setClasses = (element: HTMLElement, classes: string[]) => {
const classList = element.classList;
classList.remove(
[
'ion-valid',
'ion-invalid',
'ion-touched',
'ion-untouched',
'ion-dirty',
'ion-pristine'
);
classList.add(...classes);
].forEach(c => classList.remove(c));
classes.forEach(c => classList.add(c));
};
const startsWith = (input: string, search: string): boolean => {

View File

@ -230,7 +230,8 @@ export class StackController {
const leavingEl = leavingView ? leavingView.element : undefined;
const containerEl = this.containerEl;
if (enteringEl && enteringEl !== leavingEl) {
enteringEl.classList.add('ion-page', 'ion-page-invisible');
enteringEl.classList.add('ion-page');
enteringEl.classList.add('ion-page-invisible');
if (enteringEl.parentElement !== containerEl) {
containerEl.appendChild(enteringEl);
}