cancel
Showing results for 
Search instead for 
Did you mean: 

How to control Backspace Button/Browser Back in Fiori APP

Former Member
0 Kudos

Hi All.,

               I want to control Backspace/Browser Back Button functionality in My custom Fiori app.

The issue is.,  If I Clicked outside Input control  and I pressed Backspace, by default it is taking browser back button functionality. 

Because of this, user is getting navigated from the current page to last visited page and user losing all other data which entered in rest of the fields.

Is there any possibilities of avoid this issue?

-Mahendran

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Found the solution for controlling Backspace key issue. Here is the code for same.

        window.addEventListener("keydown", function(e){

            if(e.keyCode == 8 && document.activeElement.value == undefined)

             {

                 e.preventDefault();

             }

         });

Note: Add it inside init()

Regards,

Mahendran

Answers (0)