segmentio / evergreen

🌲 Evergreen React UI Framework by Segment
https://evergreen.segment.com
MIT License
12.39k stars 832 forks source link

ListItem Icon overlays text (gets style .ub-lft_NaNpx) #1224

Closed psiho closed 3 years ago

psiho commented 3 years ago

After moving ListItem to a child component, icon positions wrongly. Icon style somehow gets "left: NaNpx".

Modified example from your docs shows this: https://codesandbox.io/s/adoring-austin-m8kiz?file=/index.js

Cannot find a workaround for this. Any ideas?

akleiner2 commented 3 years ago

Your Item component needs to be able to accept Evergreen props, since UnorderedList relies on cloning direct children and passing spacing into them. Trade you a sandbox here: https://codesandbox.io/s/peaceful-platform-qr7tf

psiho commented 3 years ago

Oh, thx! Solved. Wasn't so obvious. Maybe an example in docs could help.