question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

useOutsideClick ignores right-click

See original GitHub issue

Description

When I use useOutsideClick, I expect it to respond to all types of click, not just regular click.

Link to Reproduction

https://codesandbox.io/s/useoutsideclick-ignores-right-click-yit1y5?file=/src/App.js

Chakra UI Version

1.8.7

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
TylerAPfledderercommented, May 21, 2022

This might be an accessibility consideration to account for folks who may use the right-click as a primary: left-handed folks or those with motor issues in the first finger.

Currently any mouse event button not the primary (0) is ignored in the hook.

Based on what I stated above, probably allow the right-click by default and turn off that or left-click via a prop?

0reactions
stale[bot]commented, Aug 13, 2022

Hi! This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs within 5 days. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

onClickOutside - VueUse
12e21 - fix: apply ignore list on keyboard clicks (#2438). v9.6.0 on 11/22/2022 ... 1988e - fix: avoid calling safari workaround on right...
Read more >
[Solved]-stop React-select from opening it's menu on right ...
Coding example for the question stop React-select from opening it's menu on right click (onContextMenu)-Reactjs.
Read more >
javascript - React, click outside event fire right after the open ...
I believe the event of the on click bubbles up, while the state is already toggled, and the ref is initialized, therefore at...
Read more >
Changelog - Chakra UI
Changelog. The Changelog gives an overview of the meaningful changes we've made to Chakra UI as we keep driving for better performance and ......
Read more >
Issues · chakra-ui/chakra-ui · GitHub - CRH
useOutsideClick ignores right-click stale Topic: Accessibility (A11y) ♿️ Issue or PR related to accessibility requirements Type: Feature Issue or PR ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found