Close dialog after back button pressed

i’m using framework7 version 3 and vuejs.
how can i close dialog when i press back button?

try this

document.addEventListener('keydown', ($Event)=> {
if ('key' in $Event) {
      const {key, keyCode} = $Event;
      if (key === 'Escape' || key === 'Esc' || keyCode === 27) {
        //or this.$f7.dialog.close();
}, false);
1 Like

F7 v3 works on Android >=4.
Const and let (ES6) works on Android >=5

thanks it works for me…

Sorry, the above part was for web development.
On device(Android), you should use this:

document.addEventListener('backbutton', ()=>{
   //your actions here
}, false);