-export const PropertyValueInput = ({ vocabulary, propertyKey, ...props }: WrappedFieldProps & PropertyValueFieldProps) =>
- <Autocomplete
- label='Value'
- suggestions={getSuggestions(props.input.value, propertyKey, vocabulary)}
- onSelect={handleSelect(props.input, props.meta)}
- {...buildProps(props)}
- onBlur={handleBlur(props.meta, props.input, vocabulary, propertyKey)}
- />;
+const PropertyValueInput = ({ vocabulary, propertyKeyId, propertyKeyName, ...props }: WrappedFieldProps & PropertyValueFieldProps) =>
+ <FormName children={data => (
+ <Autocomplete
+ label='Value'
+ disabled={props.disabled}
+ suggestions={getSuggestions(props.input.value, propertyKeyId, vocabulary)}
+ onSelect={handleSelect(PROPERTY_VALUE_FIELD_ID, data.form, props.input, props.meta)}
+ onBlur={handleBlur(PROPERTY_VALUE_FIELD_ID, data.form, props.meta, props.input, getTagValueID(propertyKeyId, props.input.value, vocabulary))}
+ onChange={(e: ChangeEvent<HTMLInputElement>) => {
+ const newValue = e.currentTarget.value;
+ const tagValueID = getTagValueID(propertyKeyId, newValue, vocabulary);
+ handleChange(data.form, tagValueID, props.input, props.meta, newValue);
+ }}
+ {...buildProps(props)}
+ />
+ )} />;