Skip to content

Conversation

@Suyog241005
Copy link
Contributor

Reasons for making this change

This PR adds support for a new ui:allowClear flag.

-Updated all theme packages to support allowClear feature

Fixes #4671

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests. I've run npx nx run-many --target=build --exclude=@rjsf/docs && npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

@Suyog241005
Copy link
Contributor Author

@heath-freenome , Hi, just a gentle follow-up to check if you’ve had a chance to look at this PR.
Would appreciate your feedback whenever you have time. Thanks!

Copy link
Member

@heath-freenome heath-freenome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Suyog241005 Sorry for the delay just got back from vacation on Monday and I've been busy.
First of all, thank you for being willing to add new features to RJSF, we really appreciate it.

I've given you some general feedback on the approach you took and a few high-level requests for changes.

@Suyog241005
Copy link
Contributor Author

@Suyog241005 Sorry for the delay just got back from vacation on Monday and I've been busy. First of all, thank you for being willing to add new features to RJSF, we really appreciate it.

I've given you some general feedback on the approach you took and a few high-level requests for changes.

@heath-freenome
Thanks for the review and for the detailed feedback.

I’ve gone through your comments and I’m actively reworking the implementation to better align with RJSF’s architecture (templates, localization via translateString, and theme-specific button handling).

@Suyog241005 Suyog241005 force-pushed the feat/allow-clear-ui-option branch from 004c188 to 88adf72 Compare December 19, 2025 10:03
@Suyog241005
Copy link
Contributor Author

@heath-freenome I’ve pushed updates addressing the feedback:

  • Renamed the UI option to ui:allowClearTextInputs

  • Added ClearButton via theme-specific templates where applicable

  • Updated handlers to use useCallback

  • Integrated localization via translateString

  • Fixed import ordering and removed unused types

Please let me know if anything needs further adjustment.

Copy link
Member

@heath-freenome heath-freenome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Suyog241005 Almost there. Thanks for responding to my previous feedback. Sorry for the slow response, between the end-of-year rush at work plus the holidays I haven't had much time to look over these PRs

@Suyog241005 Suyog241005 force-pushed the feat/allow-clear-ui-option branch 2 times, most recently from 865c632 to 68da392 Compare December 30, 2025 03:41
@Suyog241005
Copy link
Contributor Author

@heath-freenome I’ve updated the implementation based on the feedback:

  • Removed the explicit aria-label from the clear button
  • Switched to using ClearButton from registry.templates.ButtonTemplates
  • Updated ClearButton enum value to "Clear input" for proper localization usage
  • Adjusted the ClearButton className in the core theme for consistency

Please let me know if this aligns with the expected direction or if further tweaks are needed.

@Suyog241005
Copy link
Contributor Author

@heath-freenome Please let me know if there’s anything else I should adjust.

@Suyog241005 Suyog241005 force-pushed the feat/allow-clear-ui-option branch from 7b271b6 to ec13901 Compare January 3, 2026 06:58
@heath-freenome heath-freenome merged commit bbbe45a into rjsf-team:main Jan 3, 2026
5 checks passed
@heath-freenome
Copy link
Member

@Suyog241005 thanks for all your hard work on this

/** If submitButtonOptions is provided it should match the `UISchemaSubmitButtonOptions` type */
submitButtonOptions?: UISchemaSubmitButtonOptions;
/** Flag, if set to `true`, will allow the text input fields to be cleared */
allowClearTextInputs?: boolean;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Suyog241005 I just realized that we need to update the uiSchema docs to add this new flag. Are you able to do that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui options support the allowclear attribute

2 participants