Skip to content

Commit 8c982f6

Browse files
authored
fix: correct wrong fix, get test to actually do something (#16779)
#16773 added a test with _expected.html to a wrong suit, so it was ignored, and this allowed to slip in a new bug of printing the falsy hidden attribute as hidden (shortened enabled form). That fix wasn't released yet, so no changeset.
1 parent 8b106b9 commit 8c982f6

File tree

3 files changed

+1
-1
lines changed

3 files changed

+1
-1
lines changed

packages/svelte/src/internal/shared/attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ const replacements = {
2222
* @returns {string}
2323
*/
2424
export function attr(name, value, is_boolean = false) {
25-
if (value == null || (!value && is_boolean)) return '';
2625
// attribute hidden for values other than "until-found" behaves like a boolean attribute
2726
if (name === 'hidden' && value !== 'until-found') {
2827
is_boolean = true;
2928
}
29+
if (value == null || (!value && is_boolean)) return '';
3030
const normalized = (name in replacements && replacements[name].get(value)) || value;
3131
const assignment = is_boolean ? '' : `="${escape_html(normalized, true)}"`;
3232
return ` ${name}${assignment}`;
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)