Skip to content

Should rendering mirror Blade Component Attributes? #1

@NickSdot

Description

@NickSdot

Comparison with Blade component behaviour.

Value @attr Blade Component
('foo', "bar") foo="bar" foo="bar"
('foo', "1") foo="1" foo="1"
('foo', 1) foo="1" foo="1"
('foo', true) foo foo="foo"
('foo', false) (nothing) (nothing)
('foo', "0") foo="0" foo="0"
('foo', 0) foo="0" foo="0"
('foo', '') (nothing) foo
('foo', ' ') (nothing) foo
('foo', null) (nothing) (nothing)

Since foo="foo" and foo are the same, the only difference (in default, non-modifier behaviour) are empty strings and whitespace-only strings. Personally, I don't like that these render the attribute in Blade components and think that it is actually a Laravel bug (ref: laravel/framework#57463). Though, one could argue that the behaviour should be fully aligned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions