I'm having some issues when using shortid or any other unique uid generator. The moment I use shortid.generate()
as key in a table, the anchor point of my Material UI Popover
is thrown to its default position rather than appearing where the button is.
Here's a sandbox! - try removing/adding back shortid.generate()
from line 72.
I even tried uniqueId
from lodash and the same thing happens - not using a key does render the dialog on the right place though. I even changed versions of Material UI/React and nothing happened.
Any ideas?
Thanks!
EDIT - I usually use item.uid
as key since I always fetch items from a service, but if I just created the object, item.uid
is undefined
- what I did until now was to set item.uid = shortid.generate()
(a temporary uid) when I create the object and then just leave <TableRow key={item.uid}>
as is. But then I have to remove the temporary uid before I save the object.