Opened 22 months ago
#60450 new defect (bug)
Button component is missing has-text class when text prop is used
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | 6.4.3 |
| Component: | General | Keywords: | |
| Focuses: | Cc: |
Description
When using the [Button](https://developer.wordpress.org/block-editor/reference-guides/components/button/) component, adding text to the button will output the has-text class on the button.
Alternatively, the Button component has a text prop that displays the given text inside the button, but when used, the prop does not output the has-text class on the button.
<Button
variant="secondary"
text={__('Click Me', 'example')}
/>
For those who use the text prop, this creates a styling inconsistency and does not take advantage of the core has-text styling. The expected outcome would be that using the text prop outputs the has-text class on the button.
Note: See
TracTickets for help on using
tickets.