kbar icon indicating copy to clipboard operation
kbar copied to clipboard

Pass event to perform() as a second argument

Open Strajk opened this issue 2 years ago • 1 comments

To allow this use-case

perform: function (actionImpl, ev) {
  if (ev.ctrlKey || ev.metaKey) {
    window.open(url, `_blank`)
    return false // tell kbar not to hide
  } else {
    window.location.href = url
  }

To be honest, I'm not totally sure it will work correctly in all supported edge cases, for example with history, as I don't use that feature. So definitely don't merge without proper considerations.

Basically, I needed it for my project, so I've added it to my fork without giving it too much thought and it works fine for me.

If you, and others, would fancy this, I could add tests and docs.

Strajk avatar Aug 25 '22 20:08 Strajk

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
kbar ✅ Ready (Inspect) Visit Preview Aug 25, 2022 at 9:33PM (UTC)

vercel[bot] avatar Aug 25 '22 20:08 vercel[bot]

Hey! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 24 '22 22:10 stale[bot]