You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Device authorization loses keyboard focus while Approve is pending #46700
When the focused Approve button becomes disabled, the browser moves focus to <body>. After the request fails, pressing Enter does nothing until the user tabs back to the button.
How to reproduce
Open the device authorization page signed in, and focus Approve with the keyboard.
Press Enter while the approve request is slow and then fails.
Press Enter again: nothing happens, because focus is on <body>.
web/app/(auth)/device/components/__tests__/authorize-account.browser.spec.tsx ("keeps the account and code available after failure and completes a native keyboard retry") fails once the request takes a real round trip, as in #46695.
Expected
Focus stays on the action while the request is pending, for example by using focusableWhenDisabled (or aria-disabled) as other Dify forms already do, so a keyboard retry works after a failure.
The shared Button already has a loading prop for this case: it blocks activation while retaining focus and adds a decorative spinner. Its documentation recommends passing pending state to loading, rather than disabled. That provides another option here without manually managing aria-disabled. [1][2]
If the spinner is unwanted, keeping disabled={busy} and adding focusableWhenDisabled to both actions uses the same underlying focusability mechanism. [3]
Reproduced the focus loss: the native disabled prop moves focus to <body> while the request is pending. The fix follows the Dify UI button contract — pass the pending state as loading (keeps the button focusable with aria-disabled and blocks activation) on both Approve and Deny, with a browser regression test that keeps focus through a failed round trip and retries with Enter. Opening a PR shortly.
Activity
dosubot commentedon Nov 18, 2026
The shared
Buttonalready has aloadingprop for this case: it blocks activation while retaining focus and adds a decorative spinner. Its documentation recommends passing pending state toloading, rather thandisabled. That provides another option here without manually managingaria-disabled. [1] [2]If the spinner is unwanted, keeping
disabled={busy}and addingfocusableWhenDisabledto both actions uses the same underlying focusability mechanism. [3]To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.
test(web): finish the service mock migration and fix CI
BlueX888 commentedon Nov 18, 2026
Reproduced the focus loss: the native
disabledprop moves focus to<body>while the request is pending. The fix follows the Dify UI button contract — pass the pending state asloading(keeps the button focusable witharia-disabledand blocks activation) on both Approve and Deny, with a browser regression test that keeps focus through a failed round trip and retries with Enter. Opening a PR shortly.