Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inputs should not display helper text if helperText is set to false without validation errors #8829

Closed
antoinefricker opened this issue Apr 12, 2023 · 1 comment
Labels

Comments

@antoinefricker
Copy link
Contributor

antoinefricker commented Apr 12, 2023

What you were expecting:
Setting helperText={false} should hide helperText element in input components.

What happened instead:
An empty paragraph is generated introducing a small vertical offset - 3px by default 😱.

Most of the input components share the same behaviour, but usually RA uses false to prevent a ReactNode parameter to be displayed. Am I wrong on this point?

Steps to reproduce:

  • Open simple example below
  • Edit any post
  • Inspect inputs, helperText elements are outlined for easier tracking

Related code:
https://stackblitz.com/edit/github-hnmzx9?file=src%2Fposts%2FPostEdit.tsx

For example <BooleanInput> generates the following HTML

<div class="MuiFormGroup-root ra-input ra-input-commentable css-dmmspl-MuiFormGroup-root">
  {...}
  <p class="MuiFormHelperText-root css-1d1r5q-MuiFormHelperText-root"></p>
</div>
@antoinefricker antoinefricker changed the title <BooleanInput helperText={false} /> displays FormHelperText anyway <BooleanInput> should not display helper text if helperText is set to false Apr 12, 2023
@antoinefricker antoinefricker changed the title <BooleanInput> should not display helper text if helperText is set to false <BooleanInput> should not display helper text if helperText is set to false without validation errors Apr 12, 2023
@antoinefricker antoinefricker changed the title <BooleanInput> should not display helper text if helperText is set to false without validation errors Inputs should not display helper text if helperText is set to false` without validation errors Apr 12, 2023
@antoinefricker antoinefricker changed the title Inputs should not display helper text if helperText is set to false` without validation errors Inputs should not display helper text if helperText is set to false without validation errors Apr 12, 2023
@slax57 slax57 added the bug label Apr 13, 2023
@fzaninotto
Copy link
Member

Fixed by #9037

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants