try adding a blank option for form selects w/ burnettk

This commit is contained in:
jasquat 2023-05-09 11:55:59 -04:00
parent 0a1daf353a
commit 20e6d78a10
2 changed files with 3 additions and 5 deletions

View File

@ -267,6 +267,7 @@ export default function TaskShow() {
formData: any,
errors: any
) => {
console.log('errors', errors);
if ('properties' in jsonSchema) {
Object.keys(jsonSchema.properties).forEach((propertyKey: string) => {
const propertyMetadata = jsonSchema.properties[propertyKey];

View File

@ -60,11 +60,8 @@ function SelectWidget({
// this change causes chrome to also show the first option. now all browsers are consistent on our site. you no longer have to select anything.
// setting the value prop causes it to show the first option.
// calling onChange actually gets it set in the form data.
if (value === undefined) {
if (enumOptions) {
value = enumOptions[0].value;
onChange(value);
}
if (enumOptions && enumOptions[0].value !== '') {
enumOptions.unshift({ value: '', label: '' });
}
// maybe use placeholder somehow. it was previously jammed into the helperText field,