You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bug is pretty simple - when passing model to the Menubar component - if an menuItem has an id - the rendered ListItem (html li element) does not have that id. The latest version, in which this functionality was working, is 10.2.1. In the reproduction, that I have created in CodeSandbox, there is a MenuBar with 1 menuitem as model and a text which changes if there is an element in the DOM Tree with the given id. The example is uploaded with version 10.3.3. If you go to the package.json file and change the version to one before 10.3.0 , the text will change to "Element found" -> meaning that for previous versions the html li elements that get rendered by the Menubar component respect the given ids in the MenuItem array.
If there is a specific id passed to the processedItem (Menuitem) - it should be respected. Otherwise use the id of the element (if no id is provided to the Menubar component - it gets set to a unique one using the UniqueComponentId() function)
melloware
added a commit
to melloware/primereact
that referenced
this issue
Jan 23, 2024
melloware
added
Type: Bug
Issue contains a defect related to a specific component.
and removed
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
labels
Jan 23, 2024
The bug is pretty simple - when passing model to the Menubar component - if an menuItem has an id - the rendered ListItem (html li element) does not have that id. The latest version, in which this functionality was working, is 10.2.1. In the reproduction, that I have created in CodeSandbox, there is a MenuBar with 1 menuitem as model and a text which changes if there is an element in the DOM Tree with the given id. The example is uploaded with version 10.3.3. If you go to the package.json file and change the version to one before 10.3.0 , the text will change to "Element found" -> meaning that for previous versions the html li elements that get rendered by the Menubar component respect the given ids in the MenuItem array.
Reproducer
https://codesandbox.io/p/sandbox/primereact-test-forked-vcddkx?file=%2Fpackage.json%3A10%2C26
PrimeReact version
10.3.3, 10.3.2, 10.3.1, 10.3.0
React version
18.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
All browsers
Expected behavior
If an Menuitem, passed to the Menubar component, as a model, has an id -> the rendered html li item for that MenuItem to have the defined id.
The text was updated successfully, but these errors were encountered: