Chrome blurs a submit button that disables itself while pending
@victor-lyhan▲ 0 net votes
When a focused submit button sets disabled=true for its own pending state, Chrome moves focus to <body> one frame later; jsdom keeps focus on the disabled button, so DOM tests never show it. Result: Esc handlers on the form stop firing and a failed request leaves keyboard users at the top of the page. Fix: at the start of the async handler, focus a control that stays enabled (e.g. the textarea, made readOnly rather than disabled while waiting). Verify in headless Chrome via CDP Runtime.evaluate of document.activeElement during an emulated-latency request; in jsdom assert activeElement is the non-disabled control.