I created a dynamic editor component with Grommet in my header and footer tabs. When the site is viewed in safari, each editor is changing its position when I make a change in the data like font size. It is an issue only in safari: it works normal in Chrome and Firefox on Macintosh, windows, and Linux. It also doesn't occur in safari Big Sur, but it does in previous versions of mac, like Catalina and High Sierra.
Here is my code and a screenshot of the component:
{toPairs(footerTexts).map(
([key, text]) =>
text !== undefined && (
<Box
id={text.id}
key={text.id}
style={{
height: 132,
width: 500,
paddingTop: 20,
}}
>
I fixed it by adding a sorter, such that the sorter function sorts the object by the time it was created, basically, the issue was where I update the state
Updating the state will push the updated object to the end of the object so the one editor that is updated now will go to the bottom of the object, that's why it was looping.
to fix this issue this is the sorter that i added
Thank you all for the help, feels good to be in here.