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

🐛 Handle middle mouse click on feed list items #1469

Merged
merged 5 commits into from
Sep 18, 2023
Merged

Conversation

foysalit
Copy link
Contributor

@foysalit foysalit commented Sep 18, 2023

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

@foysalit foysalit requested a review from pfrazee September 18, 2023 15:09
Copy link
Collaborator

@pfrazee pfrazee left a 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?

@foysalit
Copy link
Contributor Author

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.

@foysalit
Copy link
Contributor Author

alright @pfrazee check out the new approach.

@foysalit foysalit requested a review from pfrazee September 18, 2023 19:18
@@ -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'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import {useAuxClick} from 'lib/hooks/useAuxClick.web'
import {useAuxClick} from 'lib/hooks/useAuxClick'

The .web extension gets automatically added by the bundler

Copy link
Collaborator

@pfrazee pfrazee left a 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!

@pfrazee
Copy link
Collaborator

pfrazee commented Sep 18, 2023

...after I fix the thing I broke

@pfrazee pfrazee merged commit 3c4899b into main Sep 18, 2023
4 checks passed
@pfrazee pfrazee deleted the fix-middle-mouse-click branch September 18, 2023 21:58
estrattonbailey added a commit that referenced this pull request Sep 18, 2023
…ge-settings-in-app

* origin:
  1.51
  🐛 Handle middle mouse click on feed list items (#1469)
  Various release fixes (#1470)
  Update yarn.lock
  Feed UI update working branch [WIP] (#1420)
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

Successfully merging this pull request may close these issues.

2 participants