jdorn / json-editor

JSON Schema Based Editor
MIT License
5.8k stars 1.08k forks source link

Checkbox disabled by default? #847

Closed KhantMin-coder closed 1 year ago

KhantMin-coder commented 1 year ago

Hi, I am trying to use the checkbox because in my app i want to mark the item unique ( exclusive ).

There are 2 files for this, 1 is for declairation of types and other one is for json definations

In the types file

question: {
      type: 'object';
      properties: {
        title: {
          $ref: string;
          description?: string;
        };
        description: {
          $ref: string;
          description?: string;
        };
        isExclusive: {
          type: string;
          format: string;
        };
      };
      required: ['title'];
      additionalProperties: false;
    };

in the defination file

question: {
      type: 'object',
      properties: {
        title: {
          $ref: '#/$defs/translations',
          description: QUESTION_TITLE_DESCRIPTION,
        },
        description: {
          $ref: '#/$defs/translations',
          description: QUESTION_DESC_DESCRIPTION,
        },
        isExclusive: {
          type: 'boolean',
          format: 'checkbox',
        },
      },
      required: ['title'],
      additionalProperties: false,
    },

But the thing is i am getting the checkbox. But its always disabled by default? How can i enable it. Am i missing something.

Screenshot 2023-02-27 at 2 19 38 PM