Fix Safari emoji corruption bug by inserting ZWNJ between digits/symbols (#, *) and emojis#79265
Conversation
…ols (#, *) and emojis
…n they follow emojis
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@Krishna2323 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65083795ac
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
trjExpensify
left a comment
There was a problem hiding this comment.
Looks like this is a follow-up on #77304 👍
|
@abbasifaizan70 please fix these bugs: Steps:
Monosnap.screencast.2026-01-13.16-53-42.mp4Monosnap.screencast.2026-01-13.16-54-58.mp4 |
…ace for emoji+#/* combinations
|
@Krishna2323 resolved issues. Thanks |
|
Sorry for delay. @abbasifaizan70 I'm facing few bugs related to cursor position and spacing: Steps:
Monosnap.screencast.2026-01-21.03-19-21.mp4 |
|
@Krishna2323 Thanks for deep testing. I fixed the above issues. Please have a look. Thanks Screen.Recording.2026-01-21.at.7.12.46.PM.movScreen.Recording.2026-01-21.at.7.12.08.PM.mov |
|
@abbasifaizan70 Sorry for the delay—I was OOO for a few days last week. I found one more edge case. Repro steps:
Monosnap.screencast.2026-01-28.20-04-00.mp4 |
|
@Krishna2323 Yes, the cursor requires one extra arrow press when positioned right before the emoji — this is expected behavior. |
|
@Beamanator could you please take a look at the comment above? I also tried to find a solution for this edge case, and it turns out there isn’t a safe solution for it. I think this is an acceptable trade-off—without the ZWNJ, Safari corrupts the text entirely, which is a more severe issue than requiring an extra keystroke. |
|
@Krishna2323 sure i will solve them today, I was sick for last 2 days so that's why not able to look here. |
…ithub.com/abbasifaizan70/Expensify into 75634-fixed-emoji-issue-on-safari-browser
|
@Krishna2323 @Beamanator Updated feedbacks. Please take a look. Thanks |
|
@Krishna2323 all you 🙏 |
|
Will test again and complete the checklist in an hour or two. |
|
@abbasifaizan70 There’s a bug on Safari iOS where deleting the symbol behaves weirdly — moves the cursor after the emoji. Could you please verify whether the original bug is reproducible on any version of mobile Safari? I tested on staging and it worked fine for me. If it isn’t reproducible on mobile Safari, we can skip the changes there. Steps (Mobile safari):
ios_safari_issue.mp4 |
on test on latest main and it producable on mobile safari. @Krishna2323 |
|
@Krishna2323 on the latest main. Screen.Recording.2026-02-12.at.3.47.32.AM.mov |
|
I’m not sure what the next step should be. The iOS Safari bug is pretty bad, so we’ll need to find a proper solution for that. I’ll try to investigate it further when I get a chance. BTW @abbasifaizan70, could you please explain why the same issue occurred when we applied the same logic to the number as well? |
|
|
Took some solid effort, but I believe I’ve finally found a clean solution. We’ll need to change the approach — the new approach will be: Approach Change: ZWNJ (
|
|
@abbasifaizan70 please start implementing this and test it thoroughly. Thanks! |
… digits and symbols followed by emojis
|
@Krishna2323 I updated the approach and tested all the above old scenarios and those are working fine. |
|
Reviewing... |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid_native.mp4Android: mWeb Chromeandroid_chrome.mp4iOS: HybridAppios_native.mp4iOS: mWeb Safariios_safari.mp4MacOS: Chrome / Safariweb_chrome.mp4 |
There was a problem hiding this comment.
LGTM and works well! 🚀
@Beamanator please read this comment before merging. Thanks!
Beamanator
left a comment
There was a problem hiding this comment.
Looking great, thanks so much for your hard work here y'all!
|
🚧 @Beamanator has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/Beamanator in version: 9.3.23-2 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.23-3 🚀
|
Explanation of Change
This PR inserts a Zero-Width Non-Joiner (ZWNJ) between #/* and emojis, preventing Safari from creating these sequences and ensuring the text displays correctly.
Fixed Issues
$ #75634
PROPOSAL: #75634 (comment)
Tests
Testing Steps for New Message
Testing Steps for Edit Message
Offline tests
Same as tests.
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2026-01-10.at.4.01.36.AM.mov
Android: mWeb Chrome
Screen.Recording.2026-01-10.at.3.51.44.AM.mov
iOS: Native
Screen.Recording.2026-01-10.at.3.47.17.AM.mov
iOS: mWeb Safari
Screen.Recording.2026-01-10.at.3.44.45.AM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-01-10.at.1.50.58.AM.mov