Make WordPress Core

Opened 4 months ago

#60450 new defect (bug)

Button component is missing has-text class when text prop is used

Reported by: mmcalister's profile mmcalister 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.

Change History (0)

Note: See TracTickets for help on using tickets.