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

fix web aux click on all browsers #2633

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

haileyok
Copy link
Contributor

@haileyok haileyok commented Jan 26, 2024

fixes #2631
fixes #650

Fixes the "aux click" handler to work on all browsers. Currently, auxclick support seems to be a bit sketchy: https://developer.mozilla.org/en-US/docs/Web/API/Element/auxclick_event#browser_compatibility

Instead, wrap the Link component children inside of WebAuxClickWrapper, which adds a div with onMouseDown and onMouseUp handlers.

onMouseDown prevents the middle click scroll functionality from starting. onMouseUp checks to make sure the target is not an anchor tag, and if not simulates a meta click on the targeted element. This works on all browsers.

Screen.Recording.2024-01-25.at.5.13.05.PM.mov

ts error seems to be unrelated

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.

Looks good!

@pfrazee pfrazee merged commit 065a094 into bluesky-social:main Feb 6, 2024
3 of 4 checks passed
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.

Can't auxiliary click on posts (web) Middle click/ctrl click to open post in new tab
2 participants