cca-io / rescript-mui

ReScript bindings for MUI
MIT License
254 stars 52 forks source link

Fix type of anchorEl in Popover, fixes positioning in Popover and Menu #207

Closed reebalazs closed 8 months ago

reebalazs commented 8 months ago

The anchorEl accepts a dom element, not a ref. Since it does not try to resolve the ref, the result is the same as if anchorEl would be missing.

Instead it should accept a nullable dom element.

reebalazs commented 8 months ago

Hi, please check if this fix is correct, I've only started to update to Rescript 11 + Mui 5, and so far I've only tested this with a Menu manually. However from the Mui code and docs it looks to me that anchorEl - at least in Popover and Menu - does not resolve a ref, but it simply requires a dom element to be passed.

fhammerschmidt commented 8 months ago

You are right, the TS types also don't use a ref but just a html element here. Thanks!