You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, this still does not work all the time, because of the useEffect. By the time the postMessage is called, the listener might not have been registered. I've tried to wrap it around a setTimeout with an arbitrary value.
Unfortunately, the 1 does not constantly work. I tried 10 and it works most of the time but sometimes not. So you have to use a "large enough" value like 50 or 100. But, as a consequence, the content re-renders after a few milli-seconds and cause a pretty unpleasant user experience.
Ideally, the show promise should resolve once the animation has loaded AND the content has loaded AND after the first render has been done.
The text was updated successfully, but these errors were encountered:
bakura10
changed the title
Parent modal cannot communicate accurately to child modals due to timing issues
Parent window cannot communicate accurately to child modals due to timing issues
Jul 22, 2024
My approach was to send a message from the modal back to the parent. The message sets an isInit flag on parent. After that you can pass messages to the modal.
It is a poor development workflow. The whole message passing is a bad ideea...
@mirceapiturca I've tried the Polaris work done by @vividviolet and it fixes it. Polaris components now work in App Bridge modal without the need to use src and complex modal/parent communication!
Hi,
The official documentation suggests to use the
postMessage
to communicate from parent window to child modal:There are however two problems.
useEffect
. By the time the postMessage is called, the listener might not have been registered. I've tried to wrap it around a setTimeout with an arbitrary value.Unfortunately, the 1 does not constantly work. I tried 10 and it works most of the time but sometimes not. So you have to use a "large enough" value like 50 or 100. But, as a consequence, the content re-renders after a few milli-seconds and cause a pretty unpleasant user experience.
Ideally, the
show
promise should resolve once the animation has loaded AND the content has loaded AND after the first render has been done.The text was updated successfully, but these errors were encountered: