fix(keys): call submit handler directly to avoid stale form linkage (#4858) (#4967)
Some checks failed
Publish Docker image (Multi-arch) / Build & push (amd64) (push) Has been cancelled
Publish Docker image (Multi-arch) / Build & push (arm64) (push) Has been cancelled
Publish Docker image (Multi-arch) / Create multi-arch manifests (push) Has been cancelled
Release (Linux, macOS, Windows) / Linux Release (push) Has been cancelled
Release (Linux, macOS, Windows) / macOS Release (push) Has been cancelled
Release (Linux, macOS, Windows) / Windows Release (push) Has been cancelled
Some checks failed
Publish Docker image (Multi-arch) / Build & push (amd64) (push) Has been cancelled
Publish Docker image (Multi-arch) / Build & push (arm64) (push) Has been cancelled
Publish Docker image (Multi-arch) / Create multi-arch manifests (push) Has been cancelled
Release (Linux, macOS, Windows) / Linux Release (push) Has been cancelled
Release (Linux, macOS, Windows) / macOS Release (push) Has been cancelled
Release (Linux, macOS, Windows) / Windows Release (push) Has been cancelled
Users reported that the API key edit drawer's "Save changes" button becomes unresponsive after the drawer has been open / idle for a while: no loading state, no request, no error. Reopening the drawer restores it because a fresh DOM is created. The button lived in `SheetFooter` (a portaled Base UI Sheet) and was linked to the form via the HTML `form='api-key-form'` attribute. Once the portal/DOM relationship goes stale, the click no longer triggers the form's submit event, hence the silent failure. Defensive fix: drop the cross-DOM `form` linkage and call `form.handleSubmit(onSubmit)` directly via `onClick`. The native submit path (Enter key, original `<form onSubmit>`) is preserved. Closes #4858
This commit is contained in:
parent
5e88f97ac1
commit
146dd77b83
@ -610,8 +610,8 @@ export function ApiKeysMutateDrawer({
|
|||||||
{t('Close')}
|
{t('Close')}
|
||||||
</SheetClose>
|
</SheetClose>
|
||||||
<Button
|
<Button
|
||||||
form='api-key-form'
|
type='button'
|
||||||
type='submit'
|
onClick={form.handleSubmit(onSubmit)}
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
className='w-full sm:w-auto'
|
className='w-full sm:w-auto'
|
||||||
>
|
>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user