Open Bug 2087206 Opened 18 days ago Updated 5 days ago

Retain focus on elements if they gain disabled=

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement

Tracking

()

REOPENED
161 Branch
Tracking Status
firefox161 --- fixed
firefox162 --- fixed

People

(Reporter: keithamus, Assigned: keithamus)

References

()

Details

(Keywords: leave-open)

Attachments

(13 external files)

Attachment #9671292 - Attachment description: Bug 2087206 - Don't lose focus when transitioning to disabled= r?#dom-core → Bug 2087206 - Part 1 - Don't lose focus when transitioning to disabled= r?#dom-core

A focused date or time input still loses focus when it becomes disabled. Focus
sits on an edit field inside the input's UA widget via -moz-user-focus: none.

Controls that keeps focus after becoming disabled still handle key presses.

This change makes nsGenericHTMLElement::HandleKeyboardActivation and
HTMLInputElement::PostHandleEvent clear pending keyboard activation and skip
default key handling while the control is disabled.

This change dismisses the running picker whenever an input becomes disabled,
including through a fieldset. HTMLInputElement::UpdateDisabledState dismisses
so its callbacks drop later results, and fires cancel, and closes popups.

Disabling a select leaves its open dropdown running.

This change makes HTMLSelectElement::UpdateDisabledState queue
DismissPickerForDisabled when the select becomes disabled, which hides the
parent process dropdown or the picker popover. It also allows the select
to gain focus, even when disabled, to ensure focus lands somewhere
sensible after closing.

This change makes nsFormFillController::ReadOnly treat disabled inputs and
textareas as read-only, so if they have focus they can't continue
participating in autocomplete.

Pushed by kcirkel@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ca13b3aa25e6 https://hg.mozilla.org/integration/autoland/rev/e1b70f73fff4 Part 1 - Don't lose focus when transitioning to disabled= r=layout-reviewers,emilio https://github.com/mozilla-firefox/firefox/commit/868fc2f48101 https://hg.mozilla.org/integration/autoland/rev/f4492336a3dc Part 2 - Retain focus in date/time inputs on disabling. r=desktop-theme-reviewers,reusable-components-reviewers,hjones
Status: ASSIGNED → RESOLVED
Closed: 13 days ago
Resolution: --- → FIXED
Target Milestone: --- → 161 Branch

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/64734 for changes under testing/web-platform/tests

Upstream PR merged by moz-wptsync-bot

QA Whiteboard: [qa-triage-done-c162/b161]
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #9672068 - Attachment description: Bug 2087206 - Part 4 - Dismiss input pickers when the input becomes disabled. r?#dom-core → Bug 2087206 - Part 11 - Dismiss input pickers when the input becomes disabled. r?#dom-core
Attachment #9672069 - Attachment description: Bug 2087206 - Part 5 - Close select dropdowns on disabling. r?#dom-core → Bug 2087206 - Part 12 - Close select dropdowns on disabling. r?#dom-core
Attachment #9672070 - Attachment description: Bug 2087206 - Part 6 - Stop autocomplete on inputs that become disabled. r?#dom-core → Bug 2087206 - Part 13 - Stop autocomplete on inputs that become disabled. r?#dom-core
See Also: → 1870660
Pushed by kcirkel@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/5dcac056bfbc https://hg.mozilla.org/integration/autoland/rev/e5ebbebaa7cc Part 3 - Ignore key presses on disabled focused controls. r=reusable-components-reviewers,hjones,emilio
Status: REOPENED → RESOLVED
Closed: 13 days ago → 5 days ago
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Keywords: leave-open
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: