react-jsonschema-form
react-jsonschema-form copied to clipboard
Allow customization of 'Now' and 'Clear' buttons in alt-date widget
Reasons for making this change
The Now and Clear buttons on the alt-date
widget are static. This adds support for customization via ui:options
.
Checklist
- [x] I'm updating documentation
- [x] I've checked the rendering of the Markdown text I've added
- [x] I'm adding or updating code
- [x] I've added and/or updated tests
- [x] I've updated docs if needed
- [x] I've run
npm run cs-format
on my branch to conform my code to prettier coding style
- [x] I'm adding a new feature
- [x] I've updated the playground with an example use of the feature
I'll update the docs and add a playground example, just wanted to make sure this gets merged / is the right approach first.
I also added the possibility to edit the placeholders for the dropdowns.
The code seems OK, but I guess I would bikeshed the names of the options. How about options.placeholders.year
or options.yearPlaceholder
instead of options.year
?
I can do that, I'd prefer the namespaced options.placeholders.year
option. How about the "Now" and "Clear" buttons? options.labels
?
I will try and remember to update my TimeWidget and AltTimeWidget MRs to support this once we agree on the naming convention.
@amiuhle -- are you still working on this? If so, could you update the names of the options and also add some tests? I like options.placeholders
and options.labels
as you suggested.
Is there an example for this? Or can you say what should be the code.
@epicfaace Totally forgot about this, I'll have a look next week.
@amiuhle just bumping this!
@epicfaace I put the placeholders / labels into namespaces, added docs and a placeholder example and added some tests.
Any chance this can be merged?
Closing in favor of #3460