diff --git a/apps/builder/app/builder/features/style-panel/sections/layout/layout.tsx b/apps/builder/app/builder/features/style-panel/sections/layout/layout.tsx index 086f241acc3f..6f31b175ff54 100644 --- a/apps/builder/app/builder/features/style-panel/sections/layout/layout.tsx +++ b/apps/builder/app/builder/features/style-panel/sections/layout/layout.tsx @@ -94,12 +94,13 @@ const GapTooltip = ({ // prevent closing tooltip on content click onPointerDown={(event) => event.preventDefault()} triggerProps={{ - onClick: (event) => { + onClick(event) { if (event.altKey) { event.preventDefault(); onReset(); return; } + setIsOpen(true); }, }} content={ diff --git a/apps/builder/app/builder/features/style-panel/shared/css-value-input/css-value-input.tsx b/apps/builder/app/builder/features/style-panel/shared/css-value-input/css-value-input.tsx index 092519209dc5..97ae60c8fc91 100644 --- a/apps/builder/app/builder/features/style-panel/shared/css-value-input/css-value-input.tsx +++ b/apps/builder/app/builder/features/style-panel/shared/css-value-input/css-value-input.tsx @@ -35,6 +35,7 @@ import { useState, useMemo, type ComponentProps, + type RefObject, } from "react"; import { useUnitSelect, type UnitOption } from "./unit-select"; import { parseIntermediateOrInvalidValue } from "./parse-intermediate-or-invalid-value"; @@ -99,11 +100,11 @@ const useScrub = ({ onAbort: () => void; shouldHandleEvent?: (node: Node) => boolean; }): [ - React.RefObject, - React.RefObject, + RefObject, + RefObject, ] => { - const scrubRef = useRef(null); - const inputRef = useRef(null); + const scrubRef = useRef(null); + const inputRef = useRef(null); const onChangeRef = useRef(onChange); const onChangeCompleteRef = useRef(onChangeComplete); @@ -991,8 +992,11 @@ export const CssValueInput = ({ autoFocus={autoFocus} onBlur={handleOnBlur} onKeyDown={inputPropsHandleKeyDown} - containerRef={disabled ? undefined : scrubRef} - inputRef={mergeRefs(inputRef, props.inputRef ?? null)} + inputRef={mergeRefs( + inputRef, + props.inputRef, + disabled ? undefined : scrubRef + )} name={property} color={value.type === "invalid" ? "error" : undefined} prefix={finalPrefix}