Fix paste for personal key confirmation (IdV app) #6443
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why: Because the primary user interaction we expect here is for the user to paste the personal key after clicking the "Copy" button on the personal key display page.
Testing Instructions:
Before: Content is not pasted
After: Content is pasted
Implementation Notes:
This may be a bug in Cleave.js, where after the input value is changed, it tries to format the value, and expects to use the last input value ([1][2]). This value is initially
undefined
and only set in response to keydown events, so if the user were to type regularly in the field, or use key combinations like Cmd + V, the value would be set ([3]). When directly pasting, it would beundefined
, resulting in an error trying to slice an undefined value.The resolution proposed here is to force Cleave.js to assign a string value for
lastInputValue
when initialized, via its internalupdateValueState
method ([4]).Edit: Upstream report: nosir/cleave.js#691