Closed Bug 1739522 Opened 4 years ago Closed 10 months ago

Focus issues when Clear button is enabled for <input type=search>

Categories

(Core :: DOM: Core & HTML, defect, P4)

defect

Tracking

()

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: MatsPalmgren_bugz, Assigned: tgiles)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

I noticed some focus issues when implementing the Show Password button for <input type=password> in bug 502258. The same issue also occurs with the Clear button in <input type=search>.

When you click the button the <input> element loses focus (it's now on the button so you can't type text into the control).
I fixed it for the Show Password button like so:
https://phabricator.services.mozilla.com/D130407#inline-716301

While it would be more beneficial if we didn't blur and focus the input
twice when clicking the clear search button, this is an improvement
over losing focus entirely.

I'm not entirely sure if the :focus / :focus-visible inconsistent
state issue is fixed by this change.

Depends on D243386

Assignee: nobody → tgiles
Status: NEW → ASSIGNED
Attachment #9475205 - Attachment description: Bug 1739522 - Prevent losing focus when clicking on the clear search button. r=emilio,#accessibility-frontend-reviewers → Bug 1739522 - Prevent losing focus on clear search and password reveal buttons. r=emilio,#accessibility-frontend-reviewers
Blocks: 1958971
Pushed by tgiles@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/11f55b37b32b Prevent losing focus on clear search and password reveal buttons. r=emilio,accessibility-frontend-reviewers,ayeddi
Pushed by tgiles@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f83d6aa646cb Prevent losing focus on clear search and password reveal buttons. r=emilio,accessibility-frontend-reviewers,ayeddi
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch
QA Whiteboard: [qa-triage-done-c141/b140]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: