Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!