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

Selectize, Choices and Select2 do not work with dynamic enums / watched properties #1484

Open
simontaurus opened this issue Feb 5, 2024 · 2 comments
Assignees

Comments

@simontaurus
Copy link

simontaurus commented Feb 5, 2024

General information

  • json-editor version: 2.14.0

Expected behavior

Selectize, Choices and Select2 should work also with dynamic enums / watched properties

Actual behavior

Selectize, Choices and Select2 no not work also with dynamic enums / watched properties. Only the plain mode works as expected. If this is intended, maybe just an update of the docs is needed.

Steps to reproduce the behavior

Direct link to example: playground

{
  "type": "object",
  "id": "root",
  "properties": {
    "samples": {
      "type": "array",
      "required": [
        "id"
      ],
      "options": {
        "enable_array_copy": true
      },
      "items": {
        "type": "string"
      },
      "default": [
        "Sample1",
        "Sample2"
      ]
    },
    "test_watch_plain": {
      "description": "works",
      "type": "array",
      "format": "table",
      "uniqueItems": true,
      "_format": "selectize",
      "items": {
        "type": "string",
        "watch": {
          "available_samples": "root.samples"
        },
        "enumSource": [
          {
            "source": "available_samples"
          }
        ]
      }
    },
    "test_watch_selectize": {
      "description": "works not",
      "type": "array",
      "uniqueItems": true,
      "format": "selectize",
      "options": {
        "selectize": {
          "create": false
        }
      },
      "items": {
        "type": "string",
        "watch": {
          "available_samples": "root.samples"
        },
        "enumSource": [
          {
            "source": "available_samples"
          }
        ]
      }
    },
    "test_static_selectize": {
      "description": "works",
      "type": "array",
      "uniqueItems": true,
      "format": "selectize",
      "options": {
        "selectize": {
          "create": false
        }
      },
      "items": {
        "type": "string",
        "enum": [
          "Sample1",
          "Sample2"
        ]
      }
    }
  }
}
@simontaurus
Copy link
Author

see also #665

@simontaurus
Copy link
Author

see also #1544

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

2 participants