koumoul-dev / vuetify-jsonschema-form

Create beautiful and low-effort forms that output valid data. Published on npm as @koumoul/vjsf.
https://koumoul-dev.github.io/vuetify-jsonschema-form/latest/
MIT License
546 stars 155 forks source link

All but the first "x-display": "combobox" ignored in "x-fromUrl" bound components #344

Closed jcalfee closed 1 month ago

jcalfee commented 2 years ago

If I set all three set as a combobox, only the 1st is a combobox but the rest fallback to autocomplete:

image

    "Country": {
      "type": "string",
      "title": "Country",
      "maxLength": 40,
      "x-options": {
        "fieldColProps": {
          "cols": 4
        }
      },
      "x-fromUrl": "/api/countries?q={q}&type=country",
      "x-itemsProp": "results",
      "x-itemTitle": "title",
      "x-itemKey": "id",
      "x-display": "combobox"
    },
    "State": {
      "type": "string",
      "title": "State / Province",
      "maxLength": 60,
      "x-options": {
        "fieldColProps": {
          "cols": 4
        }
      },
      "x-fromUrl": "/api/countries?q={q}&type=state&countryCode={Country}",
      "x-itemsProp": "results",
      "x-itemTitle": "title",
      "x-itemKey": "id",
      "x-display": "combobox"
    },
    "City": {
      "type": "string",
      "title": "City / Suburb / Town",
      "maxLength": 70,
      "x-options": {
        "fieldColProps": {
          "cols": 4
        }
      },
      "x-fromUrl": "/api/countries?q={q}&type=city&countryCode={Country}&state={State}",
      "x-itemsProp": "results",
      "x-itemTitle": "title",
      "x-itemKey": "id",
      "x-display": "combobox"
    }

Always happens on page refresh. There were points when I made live changes to the schema changing the last "City" x-display to combobox and was able to see it update in Vue DevTools (changed to combobox). It is more often than not that live schema changes are ignored too. A page refresh always goes back to ignoring the "x-display": "combobox" in all but the very first one ("Country").

v2.11.3