reactjs / react-modal

Accessible modal dialog component for React
http://reactcommunity.org/react-modal
MIT License
7.35k stars 810 forks source link

Why convert position property to inset? #1024

Closed gfafei closed 6 months ago

gfafei commented 1 year ago

Summary: The position property(top, right, bottom, left) is convert to inset.

The ReactModal__Content part has a inset property in style, which works fine, but not expected.

Steps to reproduce:

1. 2. 3.

Expected behavior:

keep the position property

Link to example of issue:

https://codepen.io/claydiffrient/pen/KNxgav

Additional notes:

When I debug into it, I see props passed to React.createElement still has position property, but when I inspect in chrome, position property was replaced by inset property. I don't understand, and cannot find which code take effect.

jianqiao0313 commented 6 months ago

+1, i have the same doubts.

diasbruno commented 6 months ago

Probably, it's something related to the browser. The default styles uses positions, but it shouldn't be a problem (it's just weird).