jarvelov/vue-form-json-schema

ErrorOptions not working with custom component

Fuasmattn opened this issue · 1 comments

I am using a custom vue component that wraps a default field. For validation feedback I want to add a .warning class to this component so I used this ui schema:

{
 component: 'my-input',
 model: 'test',
 fieldOptions: {
  on: ['change'],
  props: {
   placeholder,
  },
 },
 errorOptions: {
  class: ['warning'], // neither this class nor the prop is passed to the my-input component
  props: {
   validationErrorClass: 'warning',
  },
 }
}

I tried passing an additional class via errorOptions and also different props like validationErrorClass. The custom component works with the property, testing it within fieldOptions worked.

The only way this example seems to work is to not use a custom component but e.g. input. However for my use case I need this my-input component. So the actual validation works fine but errorOptions doesn't.

Is there something I'm missing? Or might this be a bug with errorOptions + custom components?

found the issue after having a look at the source code and our project's setup.

the project was setup with

options: {
 showValidationErrors: false
}

with this option set to true the errorOptions works as expected