diff --git a/cypress/integration/create.js b/cypress/integration/create.js
index 85c58d947f9..cc89b084ddd 100644
--- a/cypress/integration/create.js
+++ b/cypress/integration/create.js
@@ -249,7 +249,7 @@ describe('Create Page', () => {
});
it('should not show rich text input error message when field is untouched', () => {
- cy.get(CreatePage.elements.richTextInputError).should('not.exist');
+ cy.get(CreatePage.elements.richTextInputError).should('not.have.value');
});
it('should show rich text input error message when form is submitted', () => {
diff --git a/examples/demo/src/ra-input-rich-text.d.ts b/examples/demo/src/ra-input-rich-text.d.ts
new file mode 100644
index 00000000000..e9040f114c8
--- /dev/null
+++ b/examples/demo/src/ra-input-rich-text.d.ts
@@ -0,0 +1 @@
+declare module 'ra-input-rich-text';
diff --git a/packages/ra-input-rich-text/src/index.js b/packages/ra-input-rich-text/src/index.js
index 1b1fd2cdf6a..86a258ca1bd 100644
--- a/packages/ra-input-rich-text/src/index.js
+++ b/packages/ra-input-rich-text/src/index.js
@@ -107,18 +107,16 @@ const RichTextInput = ({
)}
- {helperText || (touched && error) ? (
-
-
-
- ) : null}
+
+
+
);
};
diff --git a/packages/ra-ui-materialui/src/input/AutocompleteArrayInput.tsx b/packages/ra-ui-materialui/src/input/AutocompleteArrayInput.tsx
index 53bf59a65f2..009fa9aa166 100644
--- a/packages/ra-ui-materialui/src/input/AutocompleteArrayInput.tsx
+++ b/packages/ra-ui-materialui/src/input/AutocompleteArrayInput.tsx
@@ -418,13 +418,11 @@ const AutocompleteArrayInput: FunctionComponent<
htmlFor: id,
})}
helperText={
- (touched && error) || helperText ? (
-
- ) : null
+
}
variant={variant}
margin={margin}
diff --git a/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx b/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx
index 4e3aa86e085..3dd44d88c29 100644
--- a/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx
+++ b/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx
@@ -362,13 +362,11 @@ const AutocompleteInput: FunctionComponent<
htmlFor: id,
})}
helperText={
- (touched && error) || helperText ? (
-
- ) : null
+
}
variant={variant}
margin={margin}
diff --git a/packages/ra-ui-materialui/src/input/BooleanInput.tsx b/packages/ra-ui-materialui/src/input/BooleanInput.tsx
index 4dddd6862df..7ab4832e50c 100644
--- a/packages/ra-ui-materialui/src/input/BooleanInput.tsx
+++ b/packages/ra-ui-materialui/src/input/BooleanInput.tsx
@@ -74,15 +74,13 @@ const BooleanInput: FunctionComponent<
/>
}
/>
- {(touched && error) || helperText ? (
-
-
-
- ) : null}
+
+
+
);
};
diff --git a/packages/ra-ui-materialui/src/input/CheckboxGroupInput.spec.tsx b/packages/ra-ui-materialui/src/input/CheckboxGroupInput.spec.tsx
index 84e3c237f2a..eb8fcc72c54 100644
--- a/packages/ra-ui-materialui/src/input/CheckboxGroupInput.spec.tsx
+++ b/packages/ra-ui-materialui/src/input/CheckboxGroupInput.spec.tsx
@@ -147,7 +147,7 @@ describe('', () => {
render={() => (
}
+ optionText={}
choices={[{ id: 'foo', foobar: 'Bar' }]}
/>
)}
@@ -223,17 +223,17 @@ describe('', () => {
render={() => }
/>
);
- expect(container.querySelector('p')).toBeNull();
+ expect(container.querySelector('p').innerHTML).toBe(' ');
});
- it('should not be displayed if field has been touched but is valid', () => {
+ it('should be empty if field has been touched but is valid', () => {
const { container } = render(