Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.59k stars 799 forks source link

Contact info widget: Make phone number clickable #6336

Open enejb opened 7 years ago

enejb commented 7 years ago

It would be great to make the phone number clickable. So that the user doesn't have to type it in when they are on the phone.

kraftbj commented 7 years ago

It is supposed to do that already when wp_is_mobile returns true: https://github.com/Automattic/jetpack/blob/master/modules/widgets/contact-info.php#L120

May need to debug either why that wasn't happening for you, switch to Jetpack's mobile UA detection, or remove the UA detection outright.

briancolinger commented 7 years ago

I've tested this on my iPhone 6 Plus using Safari and Chrome and can confirm that the phone number listed in the contact form widget on my test site is clickable.

eliorivero commented 7 years ago

@enej could you share details about which device and browser app were you using when you experienced this?

enejb commented 7 years ago

Sorry was using the latest chrome on a desktop. Why don't we link the phone numbers on desktop devices? There are ways to make calls from them as well. Also it would reduce the over all complexity of the code base.

eliorivero commented 7 years ago

It's not going to reduce the code but increasing it. If we want to display this in desktop we can't know if user has some app that would handle phone calls without adding some code to detect if Skype or Google Voice are available. We can't just display this always as a link because it's discouraging and looks broken if the user clicks it and nothing happens. According to wpcom trac this was ported from Confit theme by @aerych. Last changeset where it was removed from theme is r11771-wpcom-themes. Maybe he can give us some insight about this decision of adding tel: only on mobile back then.

aerych commented 7 years ago

Wow. Its pretty wild to get pinged regarding Confit after so long. 😆 I'm afraid I don't recall much about this, my contribution to the theme was limited. @iamtakashi might be a better resource as he championed the work and (I think) did the initial pass of the contact form where tel: was used.

iamtakashi commented 7 years ago

My memory is hazy on that too but I assume the reason was just we thought it's pretty rare that someone make a call from desktop, and the possible complications @eliorivero said. I'm not sure if I see often a call-able tel number on desktop, but that might be just me.

briancolinger commented 7 years ago

Closing this issue since the phone numbers are already clickable on mobile.

enejb commented 7 years ago

Right now on chrome when I click on a link with tel: it asks me if I want to use facetime to call.

It is true that adding a condition that would detect if your device has tel support would increase complexity. We sort of do that right now. I am arguing that the link should always be clickable. No matter what device you are on and it your device doesn't support then you are out of luck. What do you expect when you see a phone number? Why do I need to use the

Here is a good article that explains what happens on different browser and different OSs. https://css-tricks.com/the-current-state-of-telephone-links/ (It is a year old).

When I ask myself what I expect these days with phone numbers is that I am able to click on them no matter what device I am on.

For example when you google a business on desktop Google allows you to click on the phone number which then opens it up on google hangout or if you are on mobile it opens it up in your phone.

eliorivero commented 7 years ago

I sustain what I said before:

We can't just display this always as a link because it's discouraging and looks broken if the user clicks it and nothing happens.

This is a great suggestion for those using an OS/browser with the ability to click and call. The rest will see a link and when they click it, nothing will happen. They will be confused and think there's something broken. I didn't close it earlier because I do think it's a welcome addition. It's just that it must be addressed properly so users who can't click and call don't get a link but a plain text.

timnolte commented 5 years ago

It seems like, with the exception of mobile where tel: handling is basically assumed, the only route would be to use an attempt at protocol handler detection but it's not foolproof as there is no standard for browser protocol detection.