Closed Bug 1661776 Opened 1 year ago Closed 1 year ago

Print dialog's validated fields should prevent pasting invalid input

Categories

(Toolkit :: Printing, defect, P2)

defect

Tracking

()

VERIFIED FIXED
82 Branch
Tracking Status
firefox81 --- verified
firefox82 --- verified

People

(Reporter: mtigley, Assigned: mtigley)

References

(Blocks 1 open bug)

Details

(Whiteboard: [print2020_v81])

Attachments

(2 files, 1 obsolete file)

Bug 1660060 introduces a keypress listener for the scale input UI component, which blocks invalid keys (non-numeric characters, "%", etc...) from being entered. As a result copy/paste/ctrl+a commands don't work. This is a problem since chrome supports this on Windows.

This issue should add a "paste" event handler that prevents invalid input from being entered.

Whiteboard: [print2020_v81]
Summary: Print dialog's validated fields should support copy/paste/control+a → Print dialog's validated fields should prevent pasting invalid input
Assignee: nobody → mtigley
Severity: -- → S2
Status: NEW → ASSIGNED
Priority: -- → P2
Keywords: leave-open

Marking as "leave-open" because a second patch is required to handle pasting for start and end page range

Pushed by mtigley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b7b3e0312fe4
Prevent pasting invalid input into ScaleInput UI. r=emalysz
Attachment #9173402 - Attachment description: Bug 1661776 - Prevent pasting invalid input into CopiesInput element. r?emalysz → Bug 1661776 - Add a paste event handler to PrintUIControlMixin that prevents invalid inputs. r?emalysz
Attachment #9173403 - Attachment is obsolete: true
Pushed by mtigley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/94205e4e0130
Add a paste event handler to PrintUIControlMixin that prevents invalid inputs. r=emalysz

Comment on attachment 9172790 [details]
Bug 1661776 - Prevent pasting invalid input into ScaleInput UI. r?emalysz

Beta/Release Uplift Approval Request

  • User impact if declined: Users can paste invalid input into the percent scale, copies, and page range fields. This experience is inconvenient if invalid input was accidentally entered and can result in a confusing experience for the user trying to change the percent scale, copies, or page range values.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: STR:
  1. Copy "Invalid input" (or some non-numeric value) into your clipboard.
  2. Try pasting into either the percent scale, copies, or page range input fields.

Expected

Pasting invalid input should not be allowed.

Actual

The invalid input is pasted into the field.

  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Small change to how numeric input fields handle invalid paste input. Only the percent scale, copies, and page range fields are affected.
  • String changes made/needed:
Attachment #9172790 - Flags: approval-mozilla-beta?
Attachment #9173402 - Flags: approval-mozilla-beta?
Flags: qe-verify+
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Keywords: leave-open
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch

Comment on attachment 9172790 [details]
Bug 1661776 - Prevent pasting invalid input into ScaleInput UI. r?emalysz

Approved for 81.0b6.

Attachment #9172790 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9173402 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]

This issue is verified fixed using Firefox 81.0b7 (BuildId:20200906164749) and Firefox 82.0a1 (BuildId:20200907094115) on Windows 10 64bit, macOS 10.14 and Ubuntu 18.04 64bit.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.