-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Adding support to add custom attributes on SpinButton and ComboBox #9872
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
Conversation
@pagaur I'm surprised that you can't already pass those down through to combobox's autofill and buttonicon. I wonder if there is a typing issue somewhere since you can pass those options directly to autofill. @JasonGore do you have any idea why you might be able to pass a prop directly to a react element but not through a props object? |
|
Yes, I just had a discussion with the TypeScript team about this recently. The TypeScript compiler is basically hardcoded to support For now, I think the only thing you can do is cast |
Component Perf Analysis:
|
when I try to add data-nav on autofill props, compiler gives me following error: |
@pagaur Per Jason's comment this is an issue with typescript, if you type those props as any they will work and should get passed down to the input. See the screenshot attached |
cool, I will remove the autoFillCutomProps from the CL, does other changes looks fine? |
We could potentially do what ComboBox has done with Autofill in order to let InputHTMLAttributes to be mixed in but what you have right now is better because it's less confusing what the root element is this way. |
🎉 Handy links: |
Pull request checklist
$ npm run change
Description of changes
This change allows some custom attribute to set on Spin button or ComboBox components (BaseButton and Checkbox are already passing custom attributes if passed to it).
The container where we want to host buttons expects a custom property 'data-nav:true' to be set to enable keyboard navigation between various buttons on that surface.
Focus areas to test
These changes should not affect existing
Microsoft Reviewers: Open in CodeFlow