Skip to content

Commit 1e36df7

Browse files
committed
Forms: Replace <TextArea/> component with type=textarea
1 parent 83d734b commit 1e36df7

5 files changed

Lines changed: 4 additions & 64 deletions

File tree

cypress/e2e/lines.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('Lines', { tags: [Tag.Lines] }, () => {
7878

7979
// Check line text from edit page
8080
LineDetailsPage.getEditLineButton().click();
81-
LineForm.getLineTextInput().should('have.text', 'Linjateksti');
81+
LineForm.getLineTextInput().should('have.value', 'Linjateksti');
8282
LineForm.cancel();
8383
});
8484
});
@@ -117,7 +117,7 @@ describe('Lines', { tags: [Tag.Lines] }, () => {
117117

118118
// Check line text from edit page
119119
LineDetailsPage.getEditLineButton().click();
120-
LineForm.getLineTextInput().should('have.text', 'Muokattu linjateksti');
120+
LineForm.getLineTextInput().should('have.value', 'Muokattu linjateksti');
121121
LineForm.cancel();
122122
});
123123

ui/src/components/forms/common/TextAreaElement.tsx

Lines changed: 0 additions & 41 deletions
This file was deleted.

ui/src/components/forms/common/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@ export * from './NullableBooleanDropdown';
1616
export * from './ObservationDateInput';
1717
export * from './PriorityForm';
1818
export * from './ReasonForChangeForm';
19-
export * from './TextAreaElement';
2019
export * from './ValidationErrorList';
2120
export * from './ValidityPeriodForm';

ui/src/components/forms/line/LinePropertiesForm.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
FormColumn,
1414
FormRow,
1515
InputField,
16-
TextAreaElement,
1716
localizedStringRequired,
1817
requiredString,
1918
} from '../common';
@@ -185,15 +184,7 @@ export const LinePropertiesForm: FC<LinePropertiesFormProps> = ({
185184
translationPrefix="lines"
186185
fieldPath="description"
187186
testId={testIds.lineDescription}
188-
// eslint-disable-next-line react/no-unstable-nested-components
189-
inputElementRenderer={(props) => (
190-
<TextAreaElement
191-
// eslint-disable-next-line react/jsx-props-no-spreading
192-
{...props}
193-
fieldPath="description"
194-
className="h-full"
195-
/>
196-
)}
187+
type="textarea"
197188
/>
198189
</FormRow>
199190
</FormColumn>

ui/src/components/stop-registry/stops/stop-details/signage-details/SignageDetailsForm.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
FormActionButtons,
1111
InputElement,
1212
InputField,
13-
TextAreaElement,
1413
} from '../../../../forms/common';
1514
import { useDirtyFormBlockNavigation } from '../../../../forms/common/NavigationBlocker';
1615
import { SignageDetailsFormState, signageDetailsFormSchema } from './schema';
@@ -98,15 +97,7 @@ const SignageDetailsFormComponent: ForwardRefRenderFunction<
9897
fieldPath="signageInstructionExceptions"
9998
testId={testIds.signageInstructionExceptions}
10099
className="h-full"
101-
// eslint-disable-next-line react/no-unstable-nested-components, @typescript-eslint/no-unused-vars
102-
inputElementRenderer={({ fieldState, ...props }) => (
103-
<TextAreaElement
104-
// eslint-disable-next-line react/jsx-props-no-spreading
105-
{...props}
106-
fieldPath="signageInstructionExceptions"
107-
className="h-full"
108-
/>
109-
)}
100+
type="textarea"
110101
/>
111102
</Column>
112103
</Row>

0 commit comments

Comments
 (0)