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

activeClass isn't applied correctly for schemas with defaults #432

Closed
radiomime opened this issue Apr 12, 2023 · 2 comments
Closed

activeClass isn't applied correctly for schemas with defaults #432

radiomime opened this issue Apr 12, 2023 · 2 comments
Assignees
Labels

Comments

@radiomime
Copy link

radiomime commented Apr 12, 2023

intent

I'd like to apply a bootstrap activeClass to a radiobutton with a default set.

bug

{
  "schema": {
    "language": {
      "type": "string",
      "title": "Best language",
      "enum": ["JavaScript", "Python", "PHP", "Java", "C++", "other"],
      "default": "Python"
    }
  },
  "form": [
    {
      "key": "language",
      "type": "radiobuttons",
      "activeClass": "btn-primary"
    }
  ]
}

On load, yields:

Screen Shot 2023-04-12 at 1 52 22 PM

And when a different selection (C++) is chosen, yields:

Screen Shot 2023-04-12 at 1 52 29 PM

observations

This isn't an issue when there isn't a default value set. Removing "default": "Python" in the schema section above will allow the btn-primary class to apply. But when a default is provided (with the default keyword or in a value section), the btn-success class is applied.

@radiomime radiomime changed the title activeClass isn't applied correctly when activeClass isn't applied correctly for schemas with defaults Apr 12, 2023
@tchapi tchapi added the Bug label Apr 15, 2023
@tchapi tchapi self-assigned this Apr 15, 2023
@tchapi
Copy link
Member

tchapi commented Apr 15, 2023

Hi and thanks for the report

It should be fixed in 961c590, can you confirm?

@radiomime
Copy link
Author

Thanks for the quick turn around! Confirmed, it is working for the example in the issue and in my project.

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

No branches or pull requests

2 participants