Skip to content

wrong server-side rendering of attributes with true value when spreading props #9066

@wild-dino

Description

@wild-dino

Describe the bug

As is
The combination of prop spreading and passing attributes that should have an explicit true value leads to wrong server-side rendering. The same issue is described here: #6121 but the bug reappears when using the spread props, for example, when passing {...$$restProps}. It seems like this behavior is violated here:

if (value === true) str += ' ' + name;

Expected to be
Render attr="" when the value passed to it is true if it's a boolean attribute. In the case of any other attribute, attr="true" should be rendered instead (as it is when using DOM rendering).

Reproduction

<script>
	let disabled = true;
</script>

<button {...$$restProps} aria-disabled={disabled}>
<slot/>
</button>

Logs

No response

System Info

Doesn't matter for this bug

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions