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

[docs] Can we create a similar OTP component like shown in Base UI with @mui/material #45104

Closed
noobDev31 opened this issue Jan 24, 2025 · 6 comments
Assignees
Labels
support: Stack Overflow Please ask the community on Stack Overflow

Comments

@noobDev31
Copy link

noobDev31 commented Jan 24, 2025

Related page

https://mui.com/base-ui/react-input/#otp-input

Kind of issue

Unclear explanations

Issue description

Wanted to know the feasibility of creating OTP component using an OutlinedInput of mui/material
basically the only part i am struggling is passing the ref to the OutlinedInput of mui/material

Image

Context

No response

Search keywords: OTP

@noobDev31 noobDev31 added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: docs-feedback Feedback from documentation page labels Jan 24, 2025
@aarongarciah
Copy link
Member

Hey @noobDev31, please provide a sandbox or repository with the code you're trying to make it work so we can have a look. Passing a ref to OutlinedInput should work; here's an example: https://codesandbox.io/p/sandbox/holy-smoke-knt7kk

@aarongarciah aarongarciah added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 24, 2025
@aarongarciah aarongarciah self-assigned this Jan 24, 2025
@aarongarciah aarongarciah added support: Stack Overflow Please ask the community on Stack Overflow and removed support: docs-feedback Feedback from documentation page labels Jan 24, 2025
Copy link

👋 Thanks for using this project!

We use GitHub issues exclusively as a bug and feature requests tracker, however, this issue appears to be a support request.

For support with Material UI please check out https://mui.com/material-ui/getting-started/support/. Thanks!

If you have a question on Stack Overflow, you are welcome to link to it here, it might help others.
If your issue is subsequently confirmed as a bug, and the report follows the issue template, it can be reopened.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 24, 2025
@noobDev31
Copy link
Author

noobDev31 commented Jan 24, 2025

Hey @noobDev31, please provide a sandbox or repository with the code you're trying to make it work so we can have a look. Passing a ref to OutlinedInput should work; here's an example: https://codesandbox.io/p/sandbox/holy-smoke-knt7kk

Hi @aarongarciah,on the below Stackblitz link i get some issue related to select being undefined for me(mostly because i am not passing the ref properly) also on my local(attached image) I am not able to pass ref on the slotProps because it doesn't exist there
even i tried to pass ref on the root level of ref it has issues (2nd image)

https://stackblitz.com/edit/react-73e4p7qt?file=Demo.tsx,index.html

Image

Image

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Jan 24, 2025
@github-actions github-actions bot reopened this Jan 24, 2025
@noobDev31
Copy link
Author

noobDev31 commented Jan 24, 2025

Okay I think i need to pass it to inputRef root level prop also the all handlers on the root but still i get issues regarding select method not being defined on the targetIndex
https://stackblitz.com/edit/react-73e4p7qt-mvphj6u8?file=Demo.tsx,index.html

@noobDev31
Copy link
Author

noobDev31 commented Jan 24, 2025

Okay using InputBase works for me

https://stackblitz.com/edit/react-ajmuvfal?file=Demo.tsx

Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@noobDev31 How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

@github-actions github-actions bot removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support: Stack Overflow Please ask the community on Stack Overflow
Projects
None yet
Development

No branches or pull requests

2 participants