Skip to content

Text Field issue - Label name not clearing when load data in TextField #47047

@subash-rishihar

Description

@subash-rishihar

Steps to reproduce

      <TextField
        label="First Name"
        fullWidth
        size="small"
        error={!!errors.firstName}
        helperText={errors.firstName?.message}
        {...register("firstName", {
          required: "First Name is required",
          maxLength: {
            value: 30,
            message: "First Name must not exceed 30 characters",
          },
        })}
      />

Current behavior

The above code for a text filed to accept user input and save into database.
No issues when we enter data and save to db.
But when we populate the record to the filed from database, the label name is not clearing and both label name and user input appearing in text box.

Image

Expected behavior

No response

Context

No response

Your environment

Search keywords: Text Field - label not clearing when populate data

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions