Skip to content

Commit 552f19b

Browse files
committed
check if the attribute value is different before setting it
1 parent 3c5ccf6 commit 552f19b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/internal/dom.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export function self(fn) {
8686

8787
export function attr(node: Element, attribute: string, value?: string) {
8888
if (value == null) node.removeAttribute(attribute);
89-
else node.setAttribute(attribute, value);
89+
else if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value);
9090
}
9191

9292
export function set_attributes(node: Element & ElementCSSInlineStyle, attributes: { [x: string]: string }) {

0 commit comments

Comments
 (0)