mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 08:42:13 +00:00
Bug 1693069 - Focus the page range field when choosing a custom print range. r=mstriemer
Differential Revision: https://phabricator.services.mozilla.com/D118886
This commit is contained in:
parent
fde6550e6b
commit
efc6383c93
@ -2274,6 +2274,9 @@ class PageRangeInput extends PrintUIControlMixin(HTMLElement) {
|
||||
this._rangeInput.hidden = e.target.value == "all";
|
||||
this.updatePageRange();
|
||||
this.dispatchPageRange();
|
||||
if (!this._rangeInput.hidden) {
|
||||
this._rangeInput.select();
|
||||
}
|
||||
} else if (e.target == this._rangeInput) {
|
||||
this._rangeInput.focus();
|
||||
if (this._numPages) {
|
||||
|
@ -146,6 +146,7 @@ add_task(async function testPageRangeSets() {
|
||||
await BrowserTestUtils.waitForAttributeRemoval("hidden", customRange);
|
||||
|
||||
ok(!customRange.hidden, "Custom range is showing");
|
||||
is(helper.doc.activeElement, customRange, "Custom range field is focused");
|
||||
|
||||
// We need to set the input to something to ensure we do not return early
|
||||
// out of our validation function
|
||||
@ -279,6 +280,11 @@ add_task(async function testErrorClearedAfterSwitchingToAll() {
|
||||
"Wait for range error to be hidden"
|
||||
);
|
||||
ok(customRange.hidden, "Custom range is hidden");
|
||||
is(
|
||||
helper.doc.activeElement,
|
||||
helper.get("range-picker"),
|
||||
"Range picker remains focused"
|
||||
);
|
||||
await helper.closeDialog();
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user