Skip to content

Copy/Paste/Refresh keyboard shortcuts not working if using useSelection Hook #272

Open
@jon-coffey

Description

@jon-coffey

Describe the bug

I use the reagraph component in my application. It's just a part of a whole. When the useSelection Hook is used then all "global" keyboard shortcuts like copy/paste/refresh are disabled on the whole page (except if the cursor is focus-within in a texfield).

It might be the reakeys library that cuts the global hotkeys out (assumption) but I'm not able to add e.g. meta+c or ctrl+c or cmd+c as a workaround shortcut. Observations: others like shift+a work fine.

Steps to Reproduce the Bug or Issue

I forked the example on code sandbox where the behavior is visible. https://codesandbox.io/p/sandbox/reagraph-example-forked-ncjgm9?workspaceId=b7d61418-67c4-480f-8dd4-a7eb5e314ed1
If you comment out the useSelection (line 49-53), copy and paste is working again.

Expected behavior

I wish have the ability to disable the hotkey inteference from reakeys completly or that it at least that it doesn't disable defaults like copy, paste and refresh.

Platform

  • Reagraph Version: 4.19.2
  • OS: macOS
  • Browser: Chrome

Your Example Website or App

https://codesandbox.io/p/sandbox/reagraph-example-forked-ncjgm9?workspaceId=b7d61418-67c4-480f-8dd4-a7eb5e314ed1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions