-
-// Attempts to match a manually typed key label with a key ID, when the user
-// doesn't select the key from the suggestions list.
-const handleBlur = (
- formName: string,
- { dispatch }: WrappedFieldMetaProps,
- { onBlur, value }: WrappedFieldInputProps,
- vocabulary: Vocabulary) =>
- () => {
- dispatch(change(formName, PROPERTY_KEY_FIELD_ID, getTagKeyID(value, vocabulary)));
- onBlur(value);
- };
-
-// When selecting a property key, save its ID for later usage.
-const handleSelect = (
- formName: string,
- { onChange }: WrappedFieldInputProps,
- { dispatch }: WrappedFieldMetaProps) => {
- return (item:PropFieldSuggestion) => {
- onChange(item.label);
- dispatch(change(formName, PROPERTY_KEY_FIELD_ID, item.id));
- };
-};