material-ui-popup-state icon indicating copy to clipboard operation
material-ui-popup-state copied to clipboard

Feature request: default `popupId` to `useId`

Open eugene-mohc opened this issue 1 year ago • 2 comments

I would like to suggest a feature to default the popupId property to the useId hook when it has been omitted. The purpose of the useId hook is exactly for cases such as these, and it would cut down some boilerplate of always having to manually specify popupId: useId() every time.

eugene-mohc avatar Nov 20 '23 14:11 eugene-mohc

I’m not sure there’s even a reason why you’d ever want to pass a non-generated id.

tusbar avatar Dec 11 '23 19:12 tusbar

Makes sense, I'll see if I can implement this soon, would also be open to a PR.

I've generally used explicit IDs so that I can select the popup component in Selenium tests, though attaching data- attributes for test selectors would work too

jedwards1211 avatar Dec 13 '23 17:12 jedwards1211