Add an id to a MenuItem component

1 Answer 281 Views
General Discussions Menu
Michael
Top achievements
Rank 1
Michael asked on 08 Sep 2022, 04:24 PM

Hi,

     I am trying to add an Id to a MenuItem component for use in automated testing but I can't seem to get it to work. I have tried the approach mentioned in similar posts using ref but it doesn't seem to work with this component. I was wondering if anyone has any advice on how I could add an id here?

1 Answer, 1 is accepted

Sort by
0
Filip
Telerik team
answered on 12 Sep 2022, 11:05 AM

Hello, Michael,

Currently setting an ID to the MenuItem is not supported. I can recommend attaching a cssClass if that will work for your scenario:

https://stackblitz.com/edit/react-13pkeu?file=app%2Fmain.tsx


I can also suggest submitting a feature request for an id attribute in our feedback portal:

https://feedback.telerik.com/kendo-react-ui

I hope this helps.

Regards,
Filip
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Michael
Top achievements
Rank 1
commented on 12 Sep 2022, 11:18 AM

Ok, will do. Thanks for the suggestion.
Tags
General Discussions Menu
Asked by
Michael
Top achievements
Rank 1
Answers by
Filip
Telerik team
Share this question
or