try adding a blank option for form selects w/ burnettk
This commit is contained in:
parent
0a1daf353a
commit
20e6d78a10
|
@ -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];
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue