Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
iamyoki opened this issue Jun 14, 2022 · 1 comment

Comments

@iamyoki
Copy link
Contributor

iamyoki commented Jun 14, 2022

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):

  • OS: Macos
  • Browser: [e.g. chrome, safari]
  • Version: latest

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
    const onKeyDown = React.useCallback(
    function handleKeyDown(
    /**
    * @type {KeyboardEvent}
    */
    event
    ) {
    switch (state) {
    case State.IDLE:
    if (event.altKey) setState(State.HOVER)
    break
    default:
    }
    },
    [state]
    )
@phoebejaffe
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants