Open sonntag-philipp opened 1 year ago
Hi,
I get why the override is helpful for members and properties because they live in the same "namespace" of a class. But I think we should prevent the rest from being overriden.
I have this example, where I want to allow the user of my web component to pass an icon
either with a name through a property or either with a custom SVG through a slot named icon
. Here, I would like both option, icon
the property and icon
the slot, to be visible on the <ArgTypes/>
.
Do you think it's doable here ?
EDIT: I just saw that my point is the same as exposed in this issue : #19799
Describe the bug The members that are contained in the manifest override other defined properties. As all attributes in FAST are also members of a class, all attributes are always overriden by the members while analyzing the manifest.
See the extractArgTypesFromElements method defined by storybook/web-components. The order used to define the class overrides the attributes.
Solution proposal I would like to change the order of the map method to this:
This ensured in first tests that properties and members are overriden by attributes, thus correctly displayed in the Storybook.
Pull Request I'm open to create a PR for this change. I just wanted to verify that a change like this is accepted before I submit a PR.
Environment Info