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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JoyUI][Textfield] input components like TextField are missing inputProps prop #35241

Closed
2 tasks done
ninoman opened this issue Nov 23, 2022 · 4 comments
Closed
2 tasks done
Assignees
Labels
component: text field This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy

Comments

@ninoman
Copy link

ninoman commented Nov 23, 2022

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Summary 馃挕

Currently there is no way to add a data-testid on the inner input elements for JoyUI input components. in MUi there is a inputProps which you can use, which is missing in JoyUI, I think this is critical to have an ability attach testids to the input elements

Examples 馃寛

here are the props for the TextFields, BTW there is no API documentation for JoyUI

https://mui.com/material-ui/api/text-field/#props

Motivation 馃敠

No response

@ninoman ninoman added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 23, 2022
@zannager zannager added component: text field This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy labels Nov 23, 2022
@hbjORbj hbjORbj changed the title JoyUI TextField and other input's are missing inputProps prop, so there is no way to set data-testid [JoyUI][Textfield] input components like TextField are missing inputProps prop Nov 30, 2022
@siriwatknp
Copy link
Member

Thanks for the feedback. I suggest that you should convert the TextField to:

<FormControl>
  <FormLabel>...</FormLabel>
  <Input />
</FormControl>

We are waiting for the final decision to remove the TextField from Joy UI #34176

@siriwatknp siriwatknp removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 19, 2022
@BSoDium
Copy link

BSoDium commented Dec 28, 2022

Hi, I haven't found a way to integrate the inputProps prop in the <Input /> component, am I missing something?

@siriwatknp
Copy link
Member

@BSoDium You can do it via the slotProps={{ input: { 'data-testid': '...' } }}. The slotProps also apply to other Joy UI components that contain multiple slots.

<Input slotProps={{
  input: {
    // ...html input props
  }
}} />

https://mui.com/joy-ui/react-input/#inner-html-input

@BSoDium
Copy link

BSoDium commented Jan 3, 2023

Thank you @siriwatknp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: text field This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy
Projects
None yet
Development

No branches or pull requests

4 participants