One Return key press confirms "Send all funds": since #1052 alerts answer Return with their only Normal action, including irreversible ones #1139

Open
opened 2026-11-14 14:06:30 +00:00 by jarolrod · 0 comments
jarolrod commented 2026-11-14 14:06:30 +00:00 (Migrated from github.com)

Since #1052, a single press of Return in the "Send all available funds?" confirmation sends the whole wallet. Before #1052 that alert ignored Return.

To reproduce, with a wallet holding one confirmed coin:

  1. On Send, enter an address and click Use maximum.
  2. Click Review transaction, then Use maximum in "Use all available funds?".
  3. On the review, click Send transaction.
  4. In "Send all available funds?", press Return once. Do not click anything or press Tab.

The alert closes, Send complete is shown, and the mempool holds one transaction spending the wallet's only coin. At 2bd5a61e8304, before #1052, the same key press does nothing and the alert stays open.

When the alert opens, keyboard focus is on its content, not on a button. The content answers Return and Enter by triggering the alert's only action with the Normal role:

github.com/bitcoin-core/gui-qml@efc4a2c754/qml/controls/AlertPopup.qml (L159-L168)

github.com/bitcoin-core/gui-qml@efc4a2c754/qml/controls/AlertPopup.qml (L116-L135)

The comment on returnAction says this means "Return never confirms a destructive action". But "Send all funds" has no role, so it is Normal, while "Back to review" is Cancel:

github.com/bitcoin-core/gui-qml@efc4a2c754/qml/pages/wallet/SendTransactionReview.qml (L375-L399)

Other alerts whose only Normal action is hard to undo answer Return the same way:

In the #1052 review the rule was described as "In alerts, Return from a field runs the dialog's single primary action" (https://github.com/bitcoin-core/gui-qml/pull/1052#discussion_r4427774311). These alerts have no field. Marking these actions Destructive, or setting Cancel as their returnAction, would stop Return from confirming them. For comparison, Bitcoin-Qt's send confirmation makes Cancel the default button and keeps Yes disabled for 3 seconds.

macOS arm64 / Qt 6.9.0, qt6 at efc4a2c754eb, isolated regtest, native window. The send was done by hand with a real Return key, on efc4a2c754eb and on 2bd5a61e8304. For Update wallet and Close wallet I called the alert's accept(), which is what the Return handler calls, through the test bridge (one run each). Create without encryption is from the source only.

Since #1052, a single press of Return in the "Send all available funds?" confirmation sends the whole wallet. Before #1052 that alert ignored Return. To reproduce, with a wallet holding one confirmed coin: 1. On **Send**, enter an address and click **Use maximum**. 2. Click **Review transaction**, then **Use maximum** in "Use all available funds?". 3. On the review, click **Send transaction**. 4. In "Send all available funds?", press Return once. Do not click anything or press Tab. The alert closes, Send complete is shown, and the mempool holds one transaction spending the wallet's only coin. At `2bd5a61e8304`, before #1052, the same key press does nothing and the alert stays open. When the alert opens, keyboard focus is on its content, not on a button. The content answers Return and Enter by triggering the alert's only action with the Normal role: https://github.com/bitcoin-core/gui-qml/blob/efc4a2c754eb74b1d370e4bf2313ed8d22988a36/qml/controls/AlertPopup.qml#L159-L168 https://github.com/bitcoin-core/gui-qml/blob/efc4a2c754eb74b1d370e4bf2313ed8d22988a36/qml/controls/AlertPopup.qml#L116-L135 The comment on `returnAction` says this means "Return never confirms a destructive action". But "Send all funds" has no role, so it is Normal, while "Back to review" is Cancel: https://github.com/bitcoin-core/gui-qml/blob/efc4a2c754eb74b1d370e4bf2313ed8d22988a36/qml/pages/wallet/SendTransactionReview.qml#L375-L399 Other alerts whose only Normal action is hard to undo answer Return the same way: - **Update wallet** in "Wallet update required" migrates a legacy wallet to descriptors ([WalletMigrationPopup.qml#L34-L40](https://github.com/bitcoin-core/gui-qml/blob/efc4a2c754eb74b1d370e4bf2313ed8d22988a36/qml/components/WalletMigrationPopup.qml#L34-L40), [DesktopWallets.qml#L538-L552](https://github.com/bitcoin-core/gui-qml/blob/efc4a2c754eb74b1d370e4bf2313ed8d22988a36/qml/pages/wallet/DesktopWallets.qml#L538-L552)). - **Create wallet** in "Create without encryption?", which says a password cannot be set later, is marked Normal explicitly ([CreateWalletForm.qml#L217-L233](https://github.com/bitcoin-core/gui-qml/blob/efc4a2c754eb74b1d370e4bf2313ed8d22988a36/qml/pages/wallet/CreateWalletForm.qml#L217-L233)). - **Close wallet** in "Close wallet?" closes the wallet ([DesktopWallets.qml#L585-L603](https://github.com/bitcoin-core/gui-qml/blob/efc4a2c754eb74b1d370e4bf2313ed8d22988a36/qml/pages/wallet/DesktopWallets.qml#L585-L603)). In the #1052 review the rule was described as "In alerts, Return from a field runs the dialog's single primary action" (https://github.com/bitcoin-core/gui-qml/pull/1052#discussion_r4427774311). These alerts have no field. Marking these actions Destructive, or setting Cancel as their `returnAction`, would stop Return from confirming them. For comparison, Bitcoin-Qt's send confirmation makes Cancel the default button and keeps Yes disabled for 3 seconds. macOS arm64 / Qt 6.9.0, `qt6` at `efc4a2c754eb`, isolated regtest, native window. The send was done by hand with a real Return key, on `efc4a2c754eb` and on `2bd5a61e8304`. For Update wallet and Close wallet I called the alert's `accept()`, which is what the Return handler calls, through the test bridge (one run each). Create without encryption is from the source only.
Sign in to join this conversation.
No description provided.