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
538 stars 154 forks source link

maxLength error when using x-formUrl results #343

Open jcalfee opened 2 years ago

jcalfee commented 2 years ago

I'm getting an error when I select a result from x-formUrl data that is longer than 36 characters but less than my max 100: 100 characters maximum

image

If I type it, I get to 101 and the error shows up. So typing is fine. However, if I select something in the drop-down around 36 in length (the exact number I don't know), or above but less than 100 the error incorrectly shows up when I leave the field. There seems to be a second max length somewhere that is less than 36.

Happens with the default v-autocomlete and with v-combobox.

    "Country": {
      "type": "string",
      "title": "Country",
      maxLength: 100,
      "x-options": {
        "fieldColProps": {
          "cols": 4
        }
      },
      "x-fromUrl": "/api/countries?q={q}",
      "x-itemsProp": "results",
      "x-itemTitle": "title",
      "x-itemKey": "id",
      "x-display": "combobox",
    },

After q gets to United States m, the url returns:

{"count":1,"results":[{"id":1,"title":"United States Minor Outlying Islands"}]}
> 'United States Minor Outlying Islands'.length
36
jcalfee commented 2 years ago

v2.11.3