rjsf-team / react-jsonschema-form

A React component for building Web forms from JSON Schema.
https://rjsf-team.github.io/react-jsonschema-form/
Apache License 2.0
14.38k stars 2.2k forks source link

feat(core): add support for `<optgroup>` tag #4374

Open nagaozen opened 2 weeks ago

nagaozen commented 2 weeks ago

Reasons for making this change

HTML Select Element offers a native way to organize options in option groups. This update extends rjsf SelectWidget to support <optgroup> as well.

If this is related to existing tickets, include links to them as well. Use the syntax fixes #[issue number] (ex: fixes #123).

fixes #1813, #580

If your PR is non-trivial and you'd like to schedule a synchronous review, please add it to the weekly meeting agenda: https://docs.google.com/document/d/12PjTvv21k6LIky6bNQVnsplMLLnmEuypTLQF8a-8Wss/edit

Checklist

heath-freenome commented 2 weeks ago

@nagaozen Thanks for the new feature... Can you update the CHANGELOG.md to add a new minor release with notes on this feature. Also please update the tests to validate these changes. Thanks

nagaozen commented 2 weeks ago

@nagaozen Thanks for the new feature... Can you update the CHANGELOG.md to add a new minor release with notes on this feature. Also please update the tests to validate these changes. Thanks

Sure, must update the CHANGELOG and place some tests.

nagaozen commented 2 weeks ago

Alright, checklist completed!

heath-freenome commented 2 weeks ago

@nagaozen Consider doing a npm run cs-format to fix your lint errors and then making sure using npm run lint

heath-freenome commented 2 weeks ago

@nagaozen Also, since the bootstrap-4 code has nearly the same implementation, can you also add this feature to it?

nagaozen commented 2 weeks ago

@nagaozen Also, since the bootstrap-4 code has nearly the same implementation, can you also add this feature to it?

Mmm, its a core widget, shouldn't it work as is in bootstrap 4? I've never played with the bs4 version, but will take a look into it.