ericclemmons / click-to-component

Option+Click React components in your browser to instantly open the source in VS Code
MIT License
1.79k stars 63 forks source link

`Option` + `Click` on link element is overlapped with browser native download behavior. #52

Open iamyoki opened 2 years ago

iamyoki commented 2 years ago

Describe the bug Option + Click on link element is overlapped with browser native download behavior.

OS Macos

To Reproduce Steps to reproduce the behavior:

  1. Option + Click on some link element like <a href=...>
  2. Will download the link

Expected behavior Not overlapped with download behavior.

Screenshots image

Desktop (please complete the following information):

Additional context This happens because of hotkey conflict, I can think of 2 ways of solutions:

  1. Change to another hotkey.
  2. Add event.preventDefault() but that will deactivate the download behavior and that is not perfect https://github.com/ericclemmons/click-to-component/blob/535727a05ba0e68f13e74bb32f4b34ce4869586b/packages/click-to-react-component/src/ClickToComponent.js#L86-L102
benjaffe commented 1 year ago

Another solution could be allowing the user to customize what modifier key to use. For example, I'd love to be able to set it to ctrl-opt-shift click, or cmd-opt click.