Skip to content

Commit d6eded2

Browse files
committed
fix(): fix tests
1 parent 368aee7 commit d6eded2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/runtime/vdom/set-accessor.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,22 @@ export const setAccessor = (elm: HTMLElement, memberName: string, oldValue: any,
8484
// Set property if it exists and it's not a SVG
8585
const isProp = isMemberInElement(elm, memberName);
8686
const isComplex = isComplexType(newValue);
87-
const isCustomElement = elm.tagName.includes('-');
8887
if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
8988
try {
90-
if (!isCustomElement) {
91-
newValue = newValue == null ? '' : newValue;
92-
if ((elm as any)[memberName] !== newValue) {
93-
(elm as any)[memberName] = newValue;
89+
if (!elm.tagName.includes('-')) {
90+
const n = newValue == null ? '' : newValue;
91+
92+
// Workaround for Safari, moving the <input> caret when re-assigning the same valued
93+
if ((elm as any)[memberName] !== n) {
94+
(elm as any)[memberName] = n;
9495
}
9596
} else {
9697
(elm as any)[memberName] = newValue;
9798
}
9899
} catch (e) {}
99100
}
100101

102+
101103
/**
102104
* Need to manually update attribute if:
103105
* - memberName is not an attribute

0 commit comments

Comments
 (0)