Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the disabled prop for Button #16531

Merged
merged 3 commits into from Jul 11, 2019

Conversation

@rmccue
Copy link
Contributor

commented Jul 11, 2019

I noticed Button is missing documentation for the disabled prop, which is actually supported.

@@ -124,6 +124,7 @@ The presence of a `href` prop determines whether an `anchor` element is rendered

Name | Type | Default | Description
--- | --- | --- | ---
`disabled` | `bool` | `false` | Whether the button is disabled.

This comment has been minimized.

Copy link
@jorgefilipecosta

jorgefilipecosta Jul 11, 2019

Member

Hi @rmccue, thank you for your contribution 👍
Our code does not explicitly handle the disable property it ends up being supported because the props not documented here are passed as attributes to the "a" or "button" elements. Any HTML attribute supported by these elements will work.
Our documentation does not make that clear. What if we follow the same logic applied in: https://github.com/WordPress/gutenberg//blob/f6f7375d8dfa9ef52ef784e5e486c71656421770/packages/components/src/textarea-control/README.md#L98
We explicitly document:
Props not included in this set will be applied to the a or button elements.

This comment has been minimized.

Copy link
@rmccue

rmccue Jul 11, 2019

Author Contributor

We should add that text as well, but Button does actually have specific handling for disabled: if disabled is specified, it overrides the tag type. I can document both if you'd like.

This comment has been minimized.

Copy link
@rmccue

rmccue Jul 11, 2019

Author Contributor

I went ahead and updated it for that :)

This comment has been minimized.

Copy link
@jorgefilipecosta

jorgefilipecosta Jul 11, 2019

Member

I'm sorry @rmccue, I missed that in this case disabled was used. The changes look good to me 👍 Thank you for the improvements.

rmccue added some commits Jul 11, 2019

@Soean

Soean approved these changes Jul 11, 2019

@chrisvanpatten
Copy link
Member

left a comment

Makes sense to me!

@jorgefilipecosta jorgefilipecosta merged commit 924f895 into master Jul 11, 2019

1 of 2 checks passed

Filter merged Filter merged
Details
Travis CI - Pull Request Build Passed
Details

@jorgefilipecosta jorgefilipecosta deleted the document-button-disabled-prop branch Jul 11, 2019

Tug added a commit that referenced this pull request Jul 12, 2019

jg314 added a commit to jg314/gutenberg that referenced this pull request Jul 19, 2019

@youknowriad youknowriad added this to the Gutenberg 6.2 milestone Jul 26, 2019

sbardian added a commit to sbardian/gutenberg that referenced this pull request Jul 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.