fix button

This commit is contained in:
centdix
2025-05-29 12:16:39 +02:00
parent ffc6cda97f
commit 624e3798c3
2 changed files with 21 additions and 9 deletions

View File

@@ -84,7 +84,11 @@
<TriggerableByAI id={aiId} description={aiDescription} onTrigger={() => buttonEl.click()}>
<button
bind:this={buttonEl}
class={twMerge('w-full flex items-center justify-end', fixedHeight && 'h-8', $$props.class)}
class={twMerge(
'w-full flex items-center justify-end h-full',
fixedHeight && 'h-8',
$$props.class
)}
use:melt={$trigger}
{disabled}
on:click={(e) => e.stopPropagation()}

View File

@@ -46,23 +46,31 @@
})
</script>
<div class="ai-triggerable-wrapper">
{#if isAnimating}
<div class="ai-triggerable-animation"></div>
{/if}
<div class="ai-triggerable-content">
{@render children?.()}
{#if disabled}
{@render children?.()}
{/if}
{#if !disabled}
<div class="ai-triggerable-wrapper">
{#if isAnimating}
<div class="ai-triggerable-animation"></div>
{/if}
<div class="ai-triggerable-content">
{@render children?.()}
</div>
</div>
</div>
{/if}
<style>
.ai-triggerable-wrapper {
position: relative;
height: 100%;
}
.ai-triggerable-content {
/* This preserves original styling of children */
display: contents;
/* display: contents; */
height: 100%;
}
.ai-triggerable-animation {