Skip to content

Component attributes with boolean values are rendered differently when merge() is used #31939

@perifer

Description

@perifer
  • Laravel Version: 7.0.8
  • PHP Version: 7.2.26
  • Database Driver & Version: n/a

Description:

With a component that simply prints it's attributes:

<input {{ $attributes }} />

If the component is used like this:

<x-input :disabled="false" />

We would expect the rendered template to be:

<input />

But the current implementation renders:

<input disabled="" />

But if the component uses merge() like this:

<input {{ $attributes->merge() }} />

The output is what one would expect:

<input />

It's debatable how an attribute with a boolean value should be handled, but at least $attribute and $attribute->merge() should give identical output, right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions