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,
|
formData: any,
|
||||||
errors: any
|
errors: any
|
||||||
) => {
|
) => {
|
||||||
|
console.log('errors', errors);
|
||||||
if ('properties' in jsonSchema) {
|
if ('properties' in jsonSchema) {
|
||||||
Object.keys(jsonSchema.properties).forEach((propertyKey: string) => {
|
Object.keys(jsonSchema.properties).forEach((propertyKey: string) => {
|
||||||
const propertyMetadata = jsonSchema.properties[propertyKey];
|
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.
|
// 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.
|
// setting the value prop causes it to show the first option.
|
||||||
// calling onChange actually gets it set in the form data.
|
// calling onChange actually gets it set in the form data.
|
||||||
if (value === undefined) {
|
if (enumOptions && enumOptions[0].value !== '') {
|
||||||
if (enumOptions) {
|
enumOptions.unshift({ value: '', label: '' });
|
||||||
value = enumOptions[0].value;
|
|
||||||
onChange(value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// maybe use placeholder somehow. it was previously jammed into the helperText field,
|
// maybe use placeholder somehow. it was previously jammed into the helperText field,
|
||||||
|
|
Loading…
Reference in New Issue