patternfly-elements icon indicating copy to clipboard operation
patternfly-elements copied to clipboard

[bug] PFElement | should throw warning if a slot that doesn't exist is added

Open castastrophe opened this issue 6 years ago • 1 comments

If a slot is defined in the markup that doesn't exist or isn't defined for that component, I think it should throw a warning to let the users know that their content won't render because they've entered an invalid slot.

Another option would be to write some logic that would inject that markup into the default slot if the slot they've defined doesn't exist.

Right now if you do this:

<pfe-card>
    <h1 slot="foo-title">Test</h1>
    <p>Lorem ipsum.</p>
</pfe-card>

The h1 content is not rendered because no foo-title slot is defined but there's no warning about what the issue is.

castastrophe avatar Jan 18 '19 21:01 castastrophe

We may be able to cover this in SlotController

bennypowers avatar Feb 23 '22 22:02 bennypowers

Closed because PFELement is deprecated

bennypowers avatar Mar 22 '24 07:03 bennypowers