Map does not work inside of a modal

So I’m trying to use Maplibre in a React app bridge Modal component, but any interaction on the map is just not working.

Moving the map code outside of a modal works fully so the issue is only when it’s used in the <Modal> component.

This code can be used to replicate the issue.

I’d use the React Polaris Modal component but I’m keen on using only the new web components, which do not have a modal component.

Anyone has any workarounds for this?
Keen to hear if a fix is also planned on Shopify’s side.