mirror of
https://github.com/docmost/docmost.git
synced 2026-06-10 10:13:01 +08:00
prevent create property popover flash
This commit is contained in:
@@ -104,9 +104,13 @@ export function CreatePropertyPopover({ pageId, properties, onPropertyCreated }:
|
||||
}, [resetState]);
|
||||
|
||||
const handleClose = useCallback(() => {
|
||||
// Don't reset panel/selectedType/etc. here — the popover's close
|
||||
// transition is still rendering the dropdown for a frame, and
|
||||
// resetting `panel` to "typePicker" mid-close flashes the type
|
||||
// picker after the user clicks "Create field". `handleOpen`
|
||||
// resets state on the next open instead.
|
||||
setOpened(false);
|
||||
resetState();
|
||||
}, [resetState]);
|
||||
}, []);
|
||||
|
||||
const attemptClose = useCallback(() => {
|
||||
if (panel === "configure" && hasContent) {
|
||||
|
||||
Reference in New Issue
Block a user