From c96bc92042e2d5cb2a28736fd7a9dd2593a7b040 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 9 Apr 2024 17:08:02 -0500 Subject: Small logic cleanups (#3449) * Small logic cleanups * Small logic cleanups (#3451) * remove a few things * oops * stop swallowing the error * queue callbacks * oops * log error if caught * no need to be nullable * move isClosing=true up * reset `isClosing` and `closeCallbacks` on close completion and open * run queued callbacks on `open` if there are any pending * rm unnecessary ref and check * ensure order of calls is always correct * call `snapToIndex()` on open * add tester to storybook --------- Co-authored-by: Hailey --- src/components/Dialog/context.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/components/Dialog/context.ts') diff --git a/src/components/Dialog/context.ts b/src/components/Dialog/context.ts index df8bbb081..859f8edd7 100644 --- a/src/components/Dialog/context.ts +++ b/src/components/Dialog/context.ts @@ -39,8 +39,7 @@ export function useDialogControl(): DialogOuterProps['control'] { control.current.open() }, close: cb => { - control.current.close() - cb?.() + control.current.close(cb) }, }), [id, control], -- cgit 1.4.1