-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[material-ui][Rating] Component does not respect name property when generating input element id #40997
Comments
Hello Team, |
@3eggwhites I am getting the following error when running
|
Hello @ZeeshanTamboli, my bad I have removed the bad package which was causing issue during install. Kindly clone the project again to avoid any further issues |
Not sure what could be the solution here. It's incorrect that one rating component should affect the other. I'll mark it as a bug. |
Hi Team, any update on this? |
@3eggwhites Would you like to give it a try? |
Hi @mj12albert @ZeeshanTamboli |
reference - https://mui.com/material-ui/api/rating/#rating-prop-name @mj12albert @ZeeshanTamboli the Rating component does not use let me know your thoughts |
@yash49 Reviewed you PR. Thanks. |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note We value your feedback @3eggwhites! How was your experience with our support team? |
Steps to reproduce
Link to live example: I have created a small project to demonstrate the issue, repository link can be found here: https://github.com/3eggwhites/mui-rating-component-issue/
Prerequisites
Libraries Used
Setup:
git clone https://github.com/3eggwhites/mui-rating-component-issue.git
cd mui-rating-component-issue
pnpm install
pnpm -r run build
pnpm -r run preview
Steps:
http://localhost:5001/
url in Google Chrome or Safariinput
element ids associated to the Rating componentCurrent behavior
input
element ids are not generated using thename
property given to Rating componentChanging the value of Remote Rating component affects the state of Host Rating component.
Expected behavior
input
element ids should be generated using thename
property given to Rating componentChanging the value of Remote Rating component should not affect the state of Host Rating component and only change the state of Remote Rating component
Context
We are trying to use
Rating
component in a Microfrontend project. When two microfrontends which contains theRating
component are rendered on to the same DOM, they are affecting each other's state.On further inspection we found that the
input
element ids are same for theRating
components.This issue is noticed only when using
React v17
, inReact v18
the issue does not occur.The
name
property is ignored while generating ids for theinput
elements of Rating component, which is not following the api documentation https://mui.com/material-ui/api/rating/#rating-prop-nameYour environment
npx @mui/envinfo
Search keywords: Rating, material-ui
The text was updated successfully, but these errors were encountered: