From 3ffe565b3d50539470a05b1f7a65f5fed419daf5 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 7 Oct 2026 13:47:09 -0700 Subject: Desktop Send focus: a mouse click leaves the Send button focused, and that blocked the recipient field — only a field you're typing in is protected now (test opens Send with a real click) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- tools/send-enter-keys-test.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'tools/send-enter-keys-test.js') diff --git a/tools/send-enter-keys-test.js b/tools/send-enter-keys-test.js index 67997c0..aac95f8 100644 --- a/tools/send-enter-keys-test.js +++ b/tools/send-enter-keys-test.js @@ -72,11 +72,28 @@ try { check('back on Spending, history again', !(await lit()), await lit()); console.log('[recipient: Enter picks the top suggestion]'); - await page.evaluate(() => [...document.querySelectorAll('button')].find((b) => b.textContent.trim() === 'Send')?.click()); + // a REAL click: Chrome focuses the button clicked, and the recipient field + // must still take the cursor from it + const openSend = async () => { + for (const b of await page.$$('button')) if ((await b.evaluate((n) => n.textContent.trim())) === 'Send') { await b.click(); return; } + }; + await openSend(); await page.waitForSelector('textarea.send-dest', { timeout: 10000 }); await sleep(300); check('desktop: Send opens with the cursor in the recipient field', await page.evaluate(() => document.activeElement?.matches('textarea.send-dest')), await page.evaluate(() => document.activeElement?.outerHTML.slice(0, 80))); + // away and back, two ways: the cursor lands again each time + await page.evaluate(() => document.activeElement?.blur()); + await page.evaluate(() => [...document.querySelectorAll('button')].find((b) => b.textContent.trim() === 'Receive')?.click()); await sleep(600); + await openSend(); await sleep(600); + check('...again after Receive and back to Send', await page.evaluate(() => document.activeElement?.matches('textarea.send-dest')), + await page.evaluate(() => document.activeElement?.outerHTML.slice(0, 80))); + await page.evaluate(() => document.activeElement?.blur()); + await swipeTo('face-savings'); await sleep(1200); + await swipeTo('face-spending'); await sleep(1200); + await openSend(); await sleep(600); + check('...and after swiping to Savings and back', await page.evaluate(() => document.activeElement?.matches('textarea.send-dest')), + await page.evaluate(() => document.activeElement?.outerHTML.slice(0, 80))); await page.focus('textarea.send-dest'); await page.keyboard.type('adam', { delay: 80 }); let top = ''; -- cgit v1.2.3