satori icon indicating copy to clipboard operation
satori copied to clipboard

Absolute child of fragment does not position properly with true relative parent

Open tresabhi opened this issue 1 year ago • 3 comments

Bug report

Description / Observed Behavior

Giving a child an absolute position (position: 'absolute') and the parent a relative position (position: relative) allows the child to be freely positioned inside the parent using the top, bottom, left, and right CSS properties. This does not work if there is an intermediate fragment in the middle.

Expected Behavior

Working example without fragment middleman

Reproduction

Working example with fragment middleman

tresabhi avatar Mar 25 '24 22:03 tresabhi

@tresabhi You can delete your <> & </> to fix it. I am wonder if we have to handle this case. /CC @shuding

Jackie1210 avatar Oct 04 '24 15:10 Jackie1210

You probably should handle this; gut feelings!

tresabhi avatar Oct 04 '24 16:10 tresabhi

Observed this as well. Plus, an icon component from an external package which is using a Fragment causes this:

Invalid source map. Only conformant source maps can be used to find the original code. Cause: TypeError [ERR_INVALID_ARG_TYPE]: The "payload" argument must be of type object. Received null
@project:dev:  ⨯ [Error: failed to pipe response] {
@project:dev:   [cause]: TypeError: Cannot convert a Symbol value to a string
@project:dev:       at $t.next (<anonymous>)
@project:dev:       at $t.next (<anonymous>)
@project:dev:       at $t.next (<anonymous>)
@project:dev: }
react-jsx-runtime.production.js

REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");

When I patched the component to not use a Fragment this error was no more present.

dahaca avatar May 24 '25 13:05 dahaca