-
Notifications
You must be signed in to change notification settings - Fork 376
Closed
Closed
Copy link
Milestone
Description
Using the Alert component injects variantLabel prop to the alert action. This prop is only accepted by the AlertActionCloseButton and other AlerAction components.
There are two possible solutions to this
- Stop enforcing
AlertActionCloseButton(and others) to be used as the action component by stopping cloning the action and injection of additional props. Let the consumers take care of accessibility. This would be a preferred option IMO because we can actually use component composition. - Instead of using type node for the actions, make the action a render function and pass these additional props as a
innerPropsor something. Then the dev could take these accessibility props and apply them correctly. - Remove the
actionprop from the alert and replace it byonClose(and others for other alert action components) prop. The only accepted components areAlertAction*. Customization of the action is pointless and we only need the actions.
Line of code responsible: https://github.com/patternfly/patternfly-react/blob/master/packages/patternfly-4/react-core/src/components/Alert/Alert.tsx#L85
seanforyou23
Metadata
Metadata
Assignees
Labels
No labels