I need to capture the back button event before it triggers. Once the listener is activated, the back signal has already been sent.
This is my approach so far:
document.addEventListener("backbutton", () => {
console.log("[WARN] Back button pressed");
console.log("Textbox value: " + this.inputValue);
this.showConfirm();
document.removeEventListener("backbutton");
});
I don't want to lose the value of "this.inputValue". Unfortunately, in most cases, it's already lost by the time the event is triggered.