hotkeys-js icon indicating copy to clipboard operation
hotkeys-js copied to clipboard

Hotkeys are not available after call window.open function

Open TammyCT opened this issue 5 years ago • 6 comments

use hotkeys.js to call window.open, then the other hotkeys are not available, except the hotkey which call window open function.

TammyCT avatar Apr 03 '19 06:04 TammyCT

@TammyCT Write an instance with codepen, I debug it?

jaywcjlove avatar Apr 03 '19 06:04 jaywcjlove

//1 bindHotKey( ) is in a service

bindHotKey(hotkey: string,evt,permission){
    if(this.checkPermission(permission)){
        hotkeys(hotkey, (event, handler)=>{
            // Prevent the default refresh event under WINDOWS system
            event.preventDefault(); 
            switch(handler.key){
              case hotkey: 
                evt.apply(this);
                break;     
            }
        })
    }
}

//2 call service function in component ngOnInit(){ this.hotKeyService.bindHotKey(hotKey,()=>this.test(),permission) }

//3 this function call window.open test(){ const testFile = 'miaomiaomiao/xxxxx.htm';
window.open(testFile, '', 'width=850,height=800,resizable=yes') }

TammyCT avatar Apr 03 '19 06:04 TammyCT

I also have this problem, bug is also in latest 3.6.10. Demo here: https://codepen.io/anon/pen/OYvxrG?editors=1010

Sire avatar May 24 '19 11:05 Sire

@Sire What platform. There is no problem with the Chrome 74 test.

image

jaywcjlove avatar May 24 '19 11:05 jaywcjlove

Also running v 74.0.3729.169 (Official Build) (64-bit) Could possibly be a Chrome extension then, will double check.

Sire avatar May 24 '19 11:05 Sire

Verified on two clean Chrome installations in incognito with no extensions.

Firefox: Works fine, no bug. Edge: Nothing works (!)

Sire avatar May 24 '19 11:05 Sire