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

🐛 [#2665] Fix phone-parsing Safari (iOS only) #1369

Merged
merged 2 commits into from
Jan 30, 2025

Conversation

jiromaykin
Copy link
Contributor

@jiromaykin jiromaykin commented Aug 22, 2024

Taiga: https://taiga.maykinmedia.nl/project/open-inwoner/issue/2665

The turn-numbers-into-phone-links feature should be disabled with the format-detection meta-tag, but... on every Safari and iOS update this breaks again 😡; many users on new devices report the meta tag does not solve the problem, so we need to create a hack with pointer-events is zero and add a zero-width joiner ‍ to make the numbers unrecognizable.
I've also added these to the Zaaknummers e-mail templates, since those are also parsed in iOS.

While I was reproducing all this in Browserstack I found a bug in the skip-link specific for Safari only, which is also solved here.

@codecov-commenter
Copy link

codecov-commenter commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.21%. Comparing base (65b1058) to head (2bcc9a0).
Report is 48 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1369      +/-   ##
===========================================
- Coverage    94.23%   94.21%   -0.02%     
===========================================
  Files         1068     1074       +6     
  Lines        39348    39621     +273     
===========================================
+ Hits         37080    37330     +250     
- Misses        2268     2291      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jiromaykin jiromaykin force-pushed the fix/2665-safari-format branch from b7c6a77 to 0a866a3 Compare January 14, 2025 09:23
@jiromaykin jiromaykin changed the title 🐛 [#2665] Fix phone-parsing safari 🐛 [#2665] Fix phone-parsing Safari (iOS only) Jan 20, 2025
@jiromaykin jiromaykin force-pushed the fix/2665-safari-format branch from 0756b0d to d761b2e Compare January 20, 2025 13:08
@jiromaykin jiromaykin marked this pull request as ready for review January 20, 2025 13:08
Copy link
Contributor

@pi-sigma pi-sigma left a comment

Choose a reason for hiding this comment

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

Small suggestion for the new CSS class name, otherwise looking good. Browserstack is currently not working for me, I'll need to try again to test this.

@@ -62,4 +62,14 @@
display: inline;
}
}

// Remove Safari iOS phone-parsing from specific elements
.phone-parsing {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.phone-parsing {
.skip-phone-parsing {

or something like it so that the function of the class is clear from the name alone (otherwise you have to come hear to look at the comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, yeah, good one, will do.

pointer-events: none;
}
// Hide style for iOS-rendered anchor element
.phone-parsing > a {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.phone-parsing > a {
.skip-phone-parsing > a {

pointer-events: none;
}

.phone-parsing > a {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.phone-parsing > a {
.skip-phone-parsing > a {

@@ -260,6 +260,17 @@ strong .color--primary, strong .color--secondary {
border-top: 3px solid #999999;
}

/* iOS specific */

.phone-parsing {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.phone-parsing {
.skip-phone-parsing {

@jiromaykin jiromaykin force-pushed the fix/2665-safari-format branch from ff37634 to e4277c1 Compare January 27, 2025 09:29
@jiromaykin
Copy link
Contributor Author

...Browserstack is currently not working for me, I'll need to try again to test this.

@pi-sigma Actually I was not able to replicate this problem in Browserstack. Meaning: if I keep the meta-tag in the Master template as is <meta name="format-detection" content="telephone=no">, then it doesn't really matter which iphone or iOS version you choose in Browserstack, the formatting there is correctly turned off for any number. So the bug actually doesn't happen there, but I am guessing this is because Browserstack probably is not a full 100% native device. This is quite obscure.
But Hendrik specifically said the formatting problem comes back on his specific device (an iPhone mini with iOS 12 Safari) so for testing I took out the meta-tag and looked at what happens with the other code changes in place.

@jiromaykin jiromaykin marked this pull request as draft January 28, 2025 10:59
@jiromaykin jiromaykin force-pushed the fix/2665-safari-format branch from 155e080 to 2bcc9a0 Compare January 28, 2025 13:53
@jiromaykin jiromaykin marked this pull request as ready for review January 28, 2025 13:53
@jiromaykin jiromaykin requested a review from pi-sigma January 28, 2025 15:35
@alextreme alextreme merged commit 6b18dc3 into develop Jan 30, 2025
22 checks passed
@alextreme alextreme deleted the fix/2665-safari-format branch January 30, 2025 07:48
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.

5 participants