-
Notifications
You must be signed in to change notification settings - Fork 174
feat: Allow button-dropdown native attributes to be set #3554
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
base: main
Are you sure you want to change the base?
Conversation
834d1d9
to
1b79f4b
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3554 +/- ##
==========================================
- Coverage 96.55% 96.54% -0.01%
==========================================
Files 804 804
Lines 23439 23440 +1
Branches 8167 8178 +11
==========================================
Hits 22631 22631
+ Misses 801 755 -46
- Partials 7 54 +47 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
/** | ||
* Attributes to add to the native `button` element. | ||
* | ||
* It is not supported to use this attribute to apply custom styling. |
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.
What does "not supported" actually mean? Technically, style property can still be used.
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 means we don't provide any promises that it will not break in the future if you use it for styling.
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.
Should we say something like: "Do not use this property to provide custom inline styles to the component"?
@@ -326,6 +322,7 @@ export const InternalButton = React.forwardRef( | |||
disabled={disabled && !__focusable && !isDisabledWithReason} | |||
aria-disabled={hasAriaDisabled ? true : undefined} | |||
{...disabledReasonProps} | |||
{...nativeAttributes} |
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.
This can technically override the button class names, and there is no ability to access the button's assigned classnames from the outside. Should we either exclude className
from the native attributes type, or make sure the class name that comes from native attributes is merged with the one we define using clsx?
Description
Allow button native attributes to be set.
Related links, issue #, if available: AWSUI-60864
How has this been tested?
New unit tests
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md
.CONTRIBUTING.md
.Security
checkSafeUrl
function.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.