Skip to content

Commit

Permalink
Remove empty class
Browse files Browse the repository at this point in the history
  • Loading branch information
RaiVaibhav committed Apr 23, 2024
1 parent 6ac3218 commit eda555e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/svelte/src/internal/client/dom/elements/class.js
Expand Up @@ -80,6 +80,10 @@ export function set_class_list(dom, value) {

var next_class_name = dom.className;

// for performance reason remove this
if (!next_class_name) {
dom.removeAttribute('class');
}
// Set the updated className
// @ts-expect-error need to add __className to patched prototype
dom.__className = next_class_name;
Expand Down

0 comments on commit eda555e

Please sign in to comment.