Closed Bug 1135194 Opened 10 years ago Closed 10 years ago

URL text auto-selection is broken

Categories

(Firefox for iOS :: Home screen, defect)

All
iOS 8
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bnicholson, Assigned: bnicholson)

References

Details

Attachments

(1 file)

UITextField selectAll() has some weird side effects:
* The selection thumbs are inconsistently shown. In Fennec, they are not shown the first time the AwesomeScreen is opened, but they're shown all subsequent times. To narrow down what's happening here, I created a minimal project with text field whose text is selected when a button is pressed. Even in that minimal project, the thumbs alternated between being shown and not being shown.
* It causes a crash on iPhone 6 Plus (bug 1124310).

One option would be to use NSAttributedString to create the same highlighting effect that would fix these bugs (which Stefan used in his patch for bug 1109656). It would be nice to know why the built-in selection isn't working as intended, though...
Blocks: iossearch
Blocks: 1130767
No longer blocks: iossearch
Can you share your test project?
(In reply to Stefan Arentz [:st3fan] from comment #1)
> Can you share your test project?

Sure: https://github.com/thebnich/TestKeyboardCrash
Attached file Pull request
Attachment #8568277 - Flags: review?(sarentz)
Comment on attachment 8568277 [details] [review]
Pull request

I would just change selectAll() to selectedTextRange instead. See comment in PR.
Attachment #8568277 - Flags: review?(sarentz) → review+
BTW If we want the same behaviour as Safari, where the text is just selected and the caret is hidden and no selection bars are shown, we probably want a UITextField subclass. Check out my old PR for the domain completion, which does the same.
Yeah, I mentioned this in comment 0. Adding the async_dispatch was just the quick fix since hiding the carets is a lower priority bug. I'll file a separate follow-up to make sure that change doesn't get lost.
Filed bug 1136219 for the subclass/NSAttributedString implementation.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: