almende / vis

⚠️ This project is not maintained anymore! Please go to https://github.com/visjs
7.85k stars 1.48k forks source link

handle preventDefault per-keybind #3906 #4176

Closed adamschachne closed 2 years ago

adamschachne commented 5 years ago

By default, all keybinds are having their defaults prevented. This PR only calls preventDefault on keys that are not combined with ctrl, shift, or alt, because those are modifiers for normal browser hotkeys.

The same should probably be done for scroll events, considering that ctrl+scrollwheel will simultaneously zoom in/out on the canvas as well as the window. Perhaps there should be an interaction option that allows which keybinds should propogate?

Looking forward to feedback.

YakovL commented 5 years ago

FYI, Vivaldi supports one-key shortcuts, so I'm not sure this is a proper suggestion. Does this default prevention cause any actual problems?