Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

124
Vistas
Parent SPFx React hooks web part open and close children's windows. the child close hangs the parent

I have 2 applications that need to work together. the parent has a list of jobs and the user may open them in the second (child) application as many jobs as he wants. The code to open a child is:

 window.open(finalUrl, 'W' + event.data.ProjJob, "alwaysRaised=yes,titlebar=no,left=0,top=0,width=800,height=800");
    if (!inboxPopUpJobs.some(j => j.job === event.data.ProjJob)) {
      setInboxPopUpJobs(PopUpJobs => [...PopUpJobs, event.data.ProjJob]);
    }

When the child windows needs to refresh the parent and close, it sends a message using the 'broadcast-channel' library

The message is received OK by the parent with the job number so the window is intercepted by using:

 const w = window.open("", 'W' + job);

then to close it I use:

await w.close();

but now the parent window hangs, there is nothing showing in the console as error and there is no way to even refresh the browser (EDGE and Chrome) I tried: w.opener.focus(); and window.focus(); but it is still hanging.

Does any one have a suggestion how to prevent the parent from hanging? Thank you

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda