jcoreio / material-ui-popup-state

boilerplate for common Material-UI Menu, Popover and Popper use cases
https://jcoreio.github.io/material-ui-popup-state/
MIT License
452 stars 28 forks source link

Feature request: default `popupId` to `useId` #128

Closed eugene-mohc closed 2 months ago

eugene-mohc commented 11 months ago

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.

tusbar commented 11 months ago

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

jedwards1211 commented 11 months ago

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 commented 2 months ago

:tada: This issue has been resolved in version 5.2.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: