feat(TypographyMenu): add bindable "open" prop to close popover from outside
This commit is contained in:
@@ -52,6 +52,7 @@ const responsive = getContext<ResponsiveManager>('responsive');
|
||||
const isMobile = $derived(responsive?.isMobile ?? false);
|
||||
|
||||
let isDragging = $state(false);
|
||||
let isTypographyMenuOpen = $state(false);
|
||||
|
||||
// New high-performance layout engine
|
||||
const comparisonEngine = new CharacterComparisonEngine();
|
||||
@@ -76,6 +77,8 @@ function handleMove(e: PointerEvent) {
|
||||
|
||||
function startDragging(e: PointerEvent) {
|
||||
e.preventDefault();
|
||||
// Close typography menu popover
|
||||
isTypographyMenuOpen = false;
|
||||
isDragging = true;
|
||||
handleMove(e);
|
||||
}
|
||||
@@ -222,7 +225,7 @@ const scaleClass = $derived(
|
||||
class="
|
||||
relative w-full max-w-6xl h-full
|
||||
flex flex-col justify-center
|
||||
select-none touch-none cursor-ew-resize
|
||||
select-none touch-none outline-none cursor-ew-resize
|
||||
py-8 px-4 sm:py-12 sm:px-8 md:py-16 md:px-12 lg:py-20 lg:px-24
|
||||
"
|
||||
in:fade={{ duration: 300, delay: 300 }}
|
||||
@@ -253,6 +256,7 @@ const scaleClass = $derived(
|
||||
</div>
|
||||
|
||||
<TypographyMenu
|
||||
bind:open={isTypographyMenuOpen}
|
||||
class={clsx(
|
||||
'absolute z-50',
|
||||
responsive.isMobileOrTablet
|
||||
|
||||
Reference in New Issue
Block a user