Skip to content

Commit

Permalink
fix: review fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RamaChandiniDevarapalli committed Nov 13, 2024
1 parent 2720196 commit 0b00b3d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { WithInputProps } from './type';
import { GoAInputBaseControl } from './InputBaseControl';
import { checkFieldValidity } from '../../util/stringUtils';
import { onBlurForTextControl, onKeyPressForTextControl, onChangeForInputControl } from '../../util/inputControlUtils';
import { sinTitle } from '../../common/Constants';

export type GoAInputTextProps = CellProps & WithClassname & WithInputProps;

Expand Down Expand Up @@ -33,7 +34,7 @@ export const GoAInputText = (props: GoAInputTextProps): JSX.Element => {
const placeholder = appliedUiSchemaOptions?.placeholder || schema?.description || '';

const errorsFormInput = checkFieldValidity(props as ControlProps);
const isSinField = schema.title === 'Social insurance number';
const isSinField = schema.title === sinTitle;

const autoCapitalize =
uischema?.options?.componentProps?.autoCapitalize === true || uischema?.options?.autoCapitalize === true;
Expand All @@ -58,7 +59,7 @@ export const GoAInputText = (props: GoAInputTextProps): JSX.Element => {
// side effect that causes the validation to render when it shouldn't.
onChange={(name: string, value: string) => {
let formattedValue = value;
if (schema && schema.title === 'Social insurance number' && value !== '') {
if (schema && schema.title === sinTitle && value !== '') {
formattedValue = formatSin(value);
}
onChangeForInputControl({
Expand Down

0 comments on commit 0b00b3d

Please sign in to comment.