-
Notifications
You must be signed in to change notification settings - Fork 26
Generically type ButtonProps #290
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
Generically type ButtonProps #290
Conversation
8602b96
to
7ba49c9
Compare
Codecov Report
@@ Coverage Diff @@
## master #290 +/- ##
==========================================
+ Coverage 90.81% 90.90% +0.09%
==========================================
Files 1 1
Lines 98 99 +1
Branches 32 32
==========================================
+ Hits 89 90 +1
Misses 7 7
Partials 2 2
Continue to review full report at Codecov.
|
This pull request should generate no changes to |
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.
It looks like you need to add the generic type at website/src/pages/demo.tsx
.
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.
Can you introduce a generic type parameter default of HTMLButtonElement
? Then a lot of the documentation won't have to change at all, along with some of the code, and we can add a page of documentation indicating how to use types other than HTMLButtonType
for the menu button.
…ng from the change and added a doc
Co-authored-by: Wes Cossick <WesCossick@users.noreply.github.com>
Co-authored-by: Wes Cossick <WesCossick@users.noreply.github.com>
…harper/react-accessible-dropdown-menu-hook into create-type-options-for-button-ref
The requested changes have been made
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.
LGTM, thanks @caryaharper!
This change requires that a type with the constraint of HTMLElement be passed to useDropdownMenu allowing any HTML element to be used as the “button”.
The purpose of this change is to allow the user to receive buttonProps tailored to their desired HTML element.
Some test were also updated to account for the new requirement of a type being passed to the hook.
Closes #69