-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
BugSomething is broken and not working as intended in the system.Something is broken and not working as intended in the system.
Description
Issue summary
A disabled
button renders invalid markup when passed a URL prop:
<Button disabled={true} url="https://foo.com">Add product</Button>
Expected behavior
HTML is valid, without a disabled
attribute on the anchor element:
<a class="Polaris-Button Polaris-Button--disabled" href="https://foo.com" data-polaris-unstyled="true"><span class="Polaris-Button__Content"><span>Add product</span></span></a>
Actual behavior
HTML is invalid (Error: Attribute disabled not allowed on element a at this point
):
<a class="Polaris-Button Polaris-Button--disabled" disabled="" href="https://foo.com" data-polaris-unstyled="true"><span class="Polaris-Button__Content"><span>Add product</span></span></a>
diff:
- <a class="Polaris-Button Polaris-Button--disabled" disabled="" href="https://foo.com"
+ <a class="Polaris-Button Polaris-Button--disabled" href="https://foo.com"
Steps to reproduce the problem
- Go to https://codesandbox.io/s/nrz4zwlnqj?module=App.js
- Look at the rendered markup
- Validate markup against https://validator.w3.org/nu/#textarea
Specifications
- Polaris version number: 3.3.0
Metadata
Metadata
Assignees
Labels
BugSomething is broken and not working as intended in the system.Something is broken and not working as intended in the system.