hotkeys-js
hotkeys-js copied to clipboard
Hotkeys are not available after call window.open function
use hotkeys.js to call window.open, then the other hotkeys are not available, except the hotkey which call window open function.
@TammyCT Write an instance with codepen, I debug it?
//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')
}
I also have this problem, bug is also in latest 3.6.10. Demo here: https://codepen.io/anon/pen/OYvxrG?editors=1010
@Sire What platform. There is no problem with the Chrome 74 test.
Also running v 74.0.3729.169 (Official Build) (64-bit) Could possibly be a Chrome extension then, will double check.
Verified on two clean Chrome installations in incognito with no extensions.
Firefox: Works fine, no bug. Edge: Nothing works (!)