-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
🐛 Handle middle mouse click on feed list items #1469
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it not possible to handle this by attaching to document.body and firing a synthetic click
even with the metaKey set?
hmm... we could but then we would have to ignore safari. let me draw that up. |
alright @pfrazee check out the new approach. |
src/view/shell/index.web.tsx
Outdated
@@ -16,11 +16,13 @@ import {useWebMediaQueries} from '../../lib/hooks/useWebMediaQueries' | |||
import {BottomBarWeb} from './bottom-bar/BottomBarWeb' | |||
import {useNavigation} from '@react-navigation/native' | |||
import {NavigationProp} from 'lib/routes/types' | |||
import {useAuxClick} from 'lib/hooks/useAuxClick.web' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import {useAuxClick} from 'lib/hooks/useAuxClick.web' | |
import {useAuxClick} from 'lib/hooks/useAuxClick' |
The .web
extension gets automatically added by the bundler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay let's ship it!
...after I fix the thing I broke |
Addresses #650
This is a PoC that attempts to handle middle mouse click on post feed items and opens the post in a new tab. This is default behavior when using
a
tags but on non-a tags, links only open in new tab on safari (which is an anomaly and will probably be patched down the road on safari too).I'd imagine the handler will have to be added on other wrappers where posts are rendered.
More details on the default web-supported handler for this event facebook/react#11571
middle-mouse-click.mov