Hey, I want to make my custom dropdown unselectable.
Could you please advise me on how to do it?
If possible, thanks in advance
I’m using the following versions:
“@jsonforms/angular”: “3.0.0”,
“@jsonforms/angular-material”: “3.0.0”,
“@jsonforms/core”: “3.0.0”
My custom dropdown:
{{ error | jsonFormsUniqueError }}
@Component({
selector: ‘app-jsonforms-unselect’,
templateUrl: ‘./jsonforms-unselect.component.html’,
styleUrls: [‘./jsonforms-unselect.component.scss’],
})
export class JsonformsUnselectComponent extends AutocompleteControlRenderer {}
I tried to add the empty option with null value, but got the error “must be equal to one of the allowed values”.
The part of the schema:
“types”: {
“title”: “types”,
“$schema”: “http://json-schema.org/draft-07/schema#”,
“type”: “object”,
“description”: “Schema for selecting types.”,
“oneOf”: [
{
“$schema”: “http://json-schema.org/draft-07/schema#”,
“title”: “type1”,
“type”: “object”,
“properties”: {
“type_id”: {
“title”: “ID”,
“type”: “string”,
“pattern”: “[1]{24}$”
},
“flow”: {
“title”: “Flows”,
“type”: “string”,
“enum”: [
“flow1”
]
}
},
“required”: ,
“additionalProperties”: false
},
{
“$schema”: “http://json-schema.org/draft-07/schema#”,
“title”: “type2”,
“type”: “object”,
“properties”: {
“type_id”: {
“title”: “ID”,
“type”: “string”,
“pattern”: “[2]{24}$”
},
“flow”: {
“title”: “Flows”,
“type”: “string”,
“enum”: [
“flow2”
]
}
},
“required”: ,
“additionalProperties”: false
}
],
“properties”: {
“flow”: {
“enum”: [
“flow1”,
“flow2”
],
“title”: “Flows”
}
},
“required”:
}