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

130
Views
Android Back button handler react js

I am trying to stop my application from returning to the previous screen when a modal is present. This currently closes the modal but also exits the existing page and returns home.

Any ideas on how to stop this from happening ?

document.addEventListener('backbutton', function(e) {
  if(modalIsOpen === true) {
    e.preventDefault();
    setIsOpen(false);
  }
});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This is the solution I found with help from Ionic

document.addEventListener('ionBackButton', (ev) => {
            ev.detail.register(10, (processNextHandler) => {
                if (modalIsOpen === true) {
                    setIsOpen(false);
                    console.log('Handler was called!');
                    processNextHandler();
                }
            });
    });
about 4 years ago · Juan Pablo Isaza Report
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!