Js unable to prevent default action for cmd+w inside chromium(brave) browser

Viewed 16

Im using react-hotkeys-hook library to assign a shortcut to keyboard combinations. cmd+r/cmd+t are being prevented from their default behavior but when it comes to cmd+w it doesnt.

here is the library in action

useHotkeys(('cmd+w' && 'ctrl+w'), (e) => {
    e.preventDefault();
    console.log(e, '----event----');
    dispatch(sendGoogleReview(someVariable));
  });```

is this a browser restriction?

I tried other approaches aswell all yielding the same result
0 Answers
Related