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

[question]How can i hide false ouput value on checkbox. #1522

Open
RelicOfTesla opened this issue Apr 2, 2024 · 2 comments
Open

[question]How can i hide false ouput value on checkbox. #1522

RelicOfTesla opened this issue Apr 2, 2024 · 2 comments

Comments

@RelicOfTesla
Copy link

RelicOfTesla commented Apr 2, 2024

Expected behavior

{
  "test": {
    "a": true,
    "b": true,
    "c": true
  }
}

Actual behavior

{
  "test": {
    "a": true,
    "b": true,
    "c": true,
    "d": false,
    "e": false,
    "f": false,
    "g": false,
    "h": false
  }
}

Steps to reproduce the behavior

{
  "type": "object",
  "options": {
    "remove_empty_properties": true
  },
  "properties": {
    "test": {
      "type": "object",
      "options": {
        "remove_empty_properties": true
      },
      "properties": {
        "a":{"type":"boolean","format":"checkbox","options":{"dependencies":{"a":[true]}}}, 
        "b":{"type":"boolean","format":"checkbox",  "options": {"remove_empty_properties": true}},  
        "c":{"type":"boolean","format":"checkbox"},  
        "d":{"type":"boolean","format":"checkbox"},  
        "e":{"type":"boolean","format":"checkbox"},  
        "f":{"type":"boolean","format":"checkbox"},  
        "g":{"type":"boolean","format":"checkbox"},  
        "h":{"type":"boolean","format":"checkbox"} 
      }
    }
  }
}

Tried "string"/"number" type..also not support.
show_opt_in was not good idea

Maybe add a options key "remove_false_properties" ?

@RelicOfTesla RelicOfTesla changed the title [question]How can i hide false ouput value in checkbox. [question]How can i hide false ouput value on checkbox. Apr 2, 2024
@germanbisurgi
Copy link
Collaborator

remove_empty_properties removes 'undefined' and '' (empty strings).
@schmunk42 should we add "remove_false_properties" too?

@schmunk42
Copy link
Collaborator

@schmunk42 should we add "remove_false_properties" too?

Yeah, if it's easy :)

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

No branches or pull requests

3 participants