diff --git a/specifyweb/frontend/js_src/lib/components/FormFields/Field.tsx b/specifyweb/frontend/js_src/lib/components/FormFields/Field.tsx index 1d1f69191a2..c9bf11d6e51 100644 --- a/specifyweb/frontend/js_src/lib/components/FormFields/Field.tsx +++ b/specifyweb/frontend/js_src/lib/components/FormFields/Field.tsx @@ -204,22 +204,26 @@ function Field({ displayParentCatNumberPlaceHolder, ]); + const customPlaceholder = + displayPrimaryCatNumberPlaceHolder && + typeof primaryCatalogNumber === 'string' + ? primaryCatalogNumber + : displayParentCatNumberPlaceHolder && + typeof parentCatalogNumber === 'string' + ? parentCatalogNumber + : undefined; + + const { placeholder: parserPlaceholder, ...restValidationAttributes } = + validationAttributes; + return ( updateValue(target.value) + isReadOnly + ? undefined + : ({ target }): void => updateValue(target.value) } onValueChange={(value): void => updateValue(value, false)} /* diff --git a/specifyweb/frontend/js_src/lib/hooks/useResourceValue.tsx b/specifyweb/frontend/js_src/lib/hooks/useResourceValue.tsx index 6f09ec07c02..cd1cdabf53d 100644 --- a/specifyweb/frontend/js_src/lib/hooks/useResourceValue.tsx +++ b/specifyweb/frontend/js_src/lib/hooks/useResourceValue.tsx @@ -12,9 +12,9 @@ import type { Input } from '../components/Forms/validationHelpers'; import type { Parser } from '../utils/parser/definitions'; import type { RA } from '../utils/types'; import { useParser } from './resource'; -import { useParserDefaultValue } from './useParserDefaultValue'; import { useFieldParser } from './useFieldParser'; import { useFieldValidation } from './useFieldValidation'; +import { useParserDefaultValue } from './useParserDefaultValue'; /** * A hook to integrate an Input with a field on a Backbone resource