Text selection does not snap to phone number or email
Categories
(Core :: Layout, defect)
Tracking
()
People
(Reporter: sblatz, Unassigned)
References
(Blocks 1 open bug)
Details
There are often extraneous spaces and characters like "." included when the tapping and holding on a phone number or email address. See fenix issue: https://github.com/mozilla-mobile/fenix/issues/10260#issuecomment-664239349
Updated•4 years ago
|
Comment 1•4 years ago
|
||
This sounds a very common and convenient feature on phone.
Hi Kagami, can you help take a look at what's up here? Thanks!
Comment 2•4 years ago
•
|
||
The Fenix behavior is vastly different from the common Gecko behavior.
- "000 000 0000": Gecko always stops on a whitespace but somehow Fenix continues selection. There is no way to do this on desktop unless I missed something important.
- "000-000-0000": Gecko by default stops on
-
but Fenix somehow does not. This is controlled by a flaglayout.word_select.stop_at_underscore
but I don't see any line that disables it on Android.
So my immediate guess is that the Fenix behavior is from Fenix.
Comment 4•4 years ago
|
||
It seems like the relevant code and AccessibleCaretManager::IsPhoneNumber
could be a bit smarter.
Comment 5•4 years ago
•
|
||
Thanks Emilio, TIL what AccessibleCaret does! Can I enable and test it on Windows? layout.accessiblecaret.enabled
is not helpful somehow.
Ah okay, did it. Thanks!
Comment 6•4 years ago
|
||
I'm not assigning myself for now, feel free to take this if someone is working on AccessibleCaret.
Comment 7•4 years ago
•
|
||
Should there be a new category "Layout: Selection", as I think DOM: Selection is more about Selection API? What do you think?
Or maybe rename the existing category as the description and the actual bugs in it doesn't really match.
Comment 8•4 years ago
|
||
It seems TYLin made most of the AccessibleCaret work, maybe he has cycles to fix this?
Updated•4 years ago
|
Comment 10•2 months ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #4)
It seems like the relevant code and
AccessibleCaretManager::IsPhoneNumber
could be a bit smarter.
The phone number format varies from country to country. The common pattern in North American can be the following:
- 123 456 7890
- (123) 456 7890
- 123-456-7890
- 123.456.7890
We can improve the phone number selection if we can find a better regex to match the above. Country code like +1 and extension may also be considered, but they are less common.
Clear the NI since I don't have a plan to work on this at the moment.
Description
•