[UI Framework] Button component needs to support "type" HTML attribute #11871
Labels
release_note:enhancement
Team:Platform-Design
Team Label for Kibana Design Team. Support the Analyze group of plugins.
The KuiButton React component currently uses the
type
prop to specify whether it's a primary button, warning button, etc. We need to rename this prop so that people can usetype
to specify the HTML attribute, e.g.type="button"
ortype="submit"
.Steps
ui_framework/components/button/button.js
, this change will be on lines 66 and 96. Make sure that all of the references to this prop within theKuiButton
definition are updated to the new name as well. Apply the same changes toKuiLinkButton
andKuiSubmitButton
in that file.ui_framework/doc_site/src/views/button
, update every example file here to use the new prop name. You can verify that your change has had the desired result by [running the UI Framework locally]KuiButton
,KuiLinkButton
, andKuiSubmitButton
React components are used, and update them with the new prop name.ui_framework/components/button/button.test.js
, on line 37, update the test suite description and the tests themselves to reflect the changes to this prop. Run the tests. The tests will fail, so just follow the command-line instructions for updating them with the new snapshots. Do the same forlink_button.test.js
andsubmit_button.test.js
.type="submit"
as an attribute, make sure it gets rendered in the snapshot, and update the test. Do the same forlink_button.test.js
andsubmit_button.test.js
.KuiButton
,KuiLinkButton
, andKuiSubmitButton
React components are used, and update them with the new prop name.The text was updated successfully, but these errors were encountered: