Skip to content

Commit

Permalink
fix(): fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Aug 7, 2019
1 parent 368aee7 commit d6eded2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/runtime/vdom/set-accessor.ts
Expand Up @@ -84,20 +84,22 @@ export const setAccessor = (elm: HTMLElement, memberName: string, oldValue: any,
// Set property if it exists and it's not a SVG
const isProp = isMemberInElement(elm, memberName);
const isComplex = isComplexType(newValue);
const isCustomElement = elm.tagName.includes('-');
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
try {
if (!isCustomElement) {
newValue = newValue == null ? '' : newValue;
if ((elm as any)[memberName] !== newValue) {
(elm as any)[memberName] = newValue;
if (!elm.tagName.includes('-')) {
const n = newValue == null ? '' : newValue;

// Workaround for Safari, moving the <input> caret when re-assigning the same valued
if ((elm as any)[memberName] !== n) {
(elm as any)[memberName] = n;
}
} else {
(elm as any)[memberName] = newValue;
}
} catch (e) {}
}


/**
* Need to manually update attribute if:
* - memberName is not an attribute
Expand Down

0 comments on commit d6eded2

Please sign in to comment.