Skip to content

Commit

Permalink
fix(runtime): simplify classlist.add/remove for IE11 (#1760)
Browse files Browse the repository at this point in the history
fixes #1757
  • Loading branch information
cary-smith authored and manucorporat committed Jul 24, 2019
1 parent eda46f6 commit f51cb8f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/runtime/vdom/set-accessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ export const setAccessor = (elm: HTMLElement, memberName: string, oldValue: any,
}
if (BUILD.vdomClass && memberName === 'class') {
const classList = elm.classList;
classList.remove(...parseClassList(oldValue));
classList.add(...parseClassList(newValue));

parseClassList(oldValue).forEach(cls => classList.remove(cls));
parseClassList(newValue).forEach(cls => classList.add(cls));
} else if (BUILD.vdomStyle && memberName === 'style') {
// update style attribute, css properties and values
if (BUILD.updatable) {
Expand Down

0 comments on commit f51cb8f

Please sign in to comment.