Skip to content

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

Closed

Description

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>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions