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 translate button not working #6657

Merged
merged 2 commits into from
Nov 23, 2024

Conversation

auroursa
Copy link
Contributor

@auroursa auroursa commented Nov 23, 2024

Based on #6289

Fix #6287
Fix #6446

Sorry I know this is a bit repetitive, but I’m trying to provide more explanation in this PR. I've encountered this issue frequently over the past few days.

Thanks to @surfdude29’s comment, made me realize that there is a behavioral difference between clicking "Translate" in the post context menu and directly clicking the translate button under the post, so I started investigating this.

In #6084, to fix the a11y issue, we replaced <NewText> with <InlineLinkText>, which introduced to="#". But this breaks the translation and redirects the user to the homepage.

I absolutely respect the a11y fix, so I won’t revert this change. Replacing onPress={onTranslatePress} with to={translatorUrl} seems like the right approach. After removing onPress here, it will no longer be used elsewhere, so it can be safely removed import.

After testing, the translation button will work again.

test.mp4

@gaearon
Copy link
Collaborator

gaearon commented Nov 23, 2024

I'm still not able to reproduce this.

@gaearon
Copy link
Collaborator

gaearon commented Nov 23, 2024

OK, I can repro it on web at least

@gaearon gaearon force-pushed the fix-translate-button branch from c8da126 to 8dd11d2 Compare November 23, 2024 17:19
@gaearon
Copy link
Collaborator

gaearon commented Nov 23, 2024

Slightly tweaked the fix. Couldn't repro the original issue outside web but I think this should work.

@gaearon gaearon merged commit d29599f into bluesky-social:main Nov 23, 2024
6 checks passed
@auroursa auroursa deleted the fix-translate-button branch November 24, 2024 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants