fix button
This commit is contained in:
@@ -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()}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user