diff --git a/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte b/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte index 84f59161da..702d69fef4 100644 --- a/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte +++ b/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte @@ -198,12 +198,18 @@ 'w-full module flex rounded-sm cursor-pointer max-w-full', selected ? 'outline outline-offset-0 outline-2 outline-slate-500 dark:outline-gray-400' : '', 'flex relative', - $copilotCurrentStepStore === id ? 'z-[901]' : '' + $copilotCurrentStepStore === id ? 'z-[901]' : '', + 'hover:!bg-surface-secondary active:!bg-surface' )} style="width: 275px; height: 38px; background-color: {bgColor};" on:mouseenter={() => (hover = true)} on:mouseleave={() => (hover = false)} - on:pointerdown|preventDefault|stopPropagation + on:pointerdown|preventDefault|stopPropagation={() => + // setTimeout to avoid freezing event loop that handles css on pointerdown + // which makes the button feel reactive + setTimeout(() => { + dispatch('pointerdown') + })} >
{#if retry} diff --git a/frontend/src/lib/components/flows/map/VirtualItemWrapper.svelte b/frontend/src/lib/components/flows/map/VirtualItemWrapper.svelte index f1ce5ee1bb..0fd501dac1 100644 --- a/frontend/src/lib/components/flows/map/VirtualItemWrapper.svelte +++ b/frontend/src/lib/components/flows/map/VirtualItemWrapper.svelte @@ -28,19 +28,19 @@
{ - if (selectable) { - if (id) { - dispatch('select', id) - } else { - dispatch('select', label || label || '') + // setTimeout to avoid freezing event loop that handles css on pointerdown + // which makes the button feel reactive + setTimeout(() => { + if (selectable) { + dispatch('select', id || label || '') } - } + }) }} on:mouseenter={() => { hover = true