-
Notifications
You must be signed in to change notification settings - Fork 227
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
fix(button): Support anchor and button HTML attributes (#679) #680
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
Googlers can find more info about SignCLA and this PR by following this link. |
Codecov Report
@@ Coverage Diff @@
## rc0.10.0 #680 +/- ##
=========================================
Coverage 94.88% 94.88%
=========================================
Files 68 68
Lines 2852 2852
Branches 432 432
=========================================
Hits 2706 2706
Misses 50 50
Partials 96 96
Continue to review full report at Codecov.
|
I signed it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ben-mckernan you're right - this should at the very least been extending from HTMLProps. Not sure how this one snuck through the PR process without it. This looks good to me, as you're right the button can be an anchor or button element.
Thanks for fixing.
CLA was not passing, but signed in #680 (comment) |
I've chosen to extend
React.AnchorHTMLAttributes<T>
andReact.ButtonHTMLAttributes<T>
since these are the possible element types that can be rendered. However looking through the other components you seem to useHTMLProps<T>
a lot as well. There doesn't seem to be any clear reason why this is used in some places and not in others.I'm happy to change this to use
HTMLProps<T>
instead if that is the pattern you want to follow. It would make button consistent with icon-button.