mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:42:38 +00:00
The wallet password prompt takes the keyboard only after its 300 ms fade-in, so an early key goes into the field behind it #1134
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml#1134
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The wallet password prompt does not take the keyboard while it fades in. For about 0.3 s after the click that raises it, what is typed or pasted goes to the field that had the caret, in clear text, and the password is then reported as incorrect. On Send that field can be the amount.
To reproduce, with an encrypted wallet whose passphrase starts with a digit, here 5:
1, leaving the caret in the amount field.The amount reads 15. The prompt holds the rest of the passphrase and answers "The wallet password you entered was incorrect." After the passphrase is typed again in full, Review shows 15.00000000 BTC. Nothing was sent.
10.5became 0.59, 3 of 3)2Review shows the changed amount, note and fee rate before anything is sent. If it is sent, the note is saved as the payee address's label, which the wallet file does not encrypt and the app's pages cannot edit (#638).
The prompt is a modal popup without
focus: true. It has a 300 ms enter transition:github.com/bitcoin-core/gui-qml@2bd5a61e83/qml/components/WalletPassphrasePopup.qml (L42-L57)and gives its field the focus only in
onOpened, which Qt emits when the transition has finished:github.com/bitcoin-core/gui-qml@2bd5a61e83/qml/components/WalletPassphrasePopup.qml (L89-L92)On Sign message the prompt's field had the focus 285 to 334 ms after the click in 26 of 30 polls, on a loaded machine. The app's
AlertPopupsetsfocus: trueand had the focus at the first sample, 12 of 12. With a mouse this is macOS only, by Qt's source: there a Qt Quick button does not take the focus when clicked, so the caret stays in the field. Linux and Windows were not run. Bitcoin-Qt's prompt, by its source, is a modal dialog that takes the keyboard when shown.Seven other dialogs have no
focus: trueand never take the keyboard. In Open payment request the text box has no caret and typing goes to the Send form behind it.#1052 at
e89a2bcd4624and #1060 at733018ca9eabrebuild the prompt on a dialog base withfocus: true, by their diffs. Keys would no longer reach the page, but early characters would be dropped and the first attempt would still fail.Reproduced on
qt6at2bd5a61e8304andeed1f426fcb6, macOS arm64 / Qt 6.9.0, isolated regtest. The Send cases are offscreen only; Sign message also in a native window. Limits:#1052 fixed most of this. On
qt6atefc4a2c754ebno early key or paste reached the field behind the prompt in any run: the Send amount stayed 1, and the note and the message to sign were unchanged.Two smaller things remain. Where an early key goes now depends on how the prompt was last closed:
The field gets the keyboard only when the fade has finished:
github.com/bitcoin-core/gui-qml@efc4a2c754/qml/controls/DialogPopup.qml (L192-L213)Giving the field focus as the prompt opens, as it already has after a successful unlock, would cover both. The seven other dialogs mentioned above now all take the keyboard; Open payment request has the caret.
Reproduced offscreen on
efc4a2c754eb, macOS arm64 / Qt 6.9.0, isolated regtest. Early keys were key events sent through the test bridge to the window's focus item; no physical key was pressed. The custom fee-rate row was not re-run.