Skip to content
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

Submit button ignores custom CSS classes passed via ui:submitButtonOptions #2868

Closed
3 of 4 tasks
ewaldbenes opened this issue May 23, 2022 · 2 comments
Closed
3 of 4 tasks
Assignees
Labels
bug needs triage Initial label given, to be assigned correct labels and assigned

Comments

@ewaldbenes
Copy link

Prerequisites

What theme are you using?

core

Version

4.2.0

Current Behavior

I want to customize the appearance of the submit button via passing custom CSS classes. I took the example from the docs to accomplish that.

"ui:submitButtonOptions": {
   "props": {
      "disabled": false,
      "className": "my-custom-class",
   },
    "norender": false,
    "submitText": "Submit"
  }
}

my-custom-class is never injected into the DOM.

I figured out that this line of code in file packages/core/src/components/widgets/SubmitButton.js

...
<button type="submit" {...submitButtonProps} className="btn btn-info">
...

causes the className property content always to be overwritten with btn btn-info which renders this property useless.

Am I right with my conclusion? If yes, should I provide a PR or how should we proceed on this?

Expected Behavior

Custom provided CSS classes should override all default or existing classes.

Steps To Reproduce

Happens always if schema contains customization for the submit button as described above.

Environment

- OS: Ubuntu 20.04
- Node: v16.15.0
- npm: 8.5.5

Anything else?

No response

@ewaldbenes ewaldbenes added bug needs triage Initial label given, to be assigned correct labels and assigned labels May 23, 2022
@heath-freenome
Copy link
Member

@ewaldbenes You are correct in your assessment. I encourage you to create a PR against the upcoming v5 release (in the rjsf-v5 branch). Ping me on the discord server if you need help

@heath-freenome
Copy link
Member

This has been fixed in the v5 beta, see the 5.x migration guide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs triage Initial label given, to be assigned correct labels and assigned
Projects
None yet
Development

No branches or pull requests

4 participants