Fix style attribute getting wiped away incorrectly
This fixes an issue where any update to a component would un-set the `style` attribute, which interacts poorly with actions that use inline styles (like Popper)
This commit is contained in:
@@ -79,6 +79,15 @@
|
|||||||
!(features & Features.Static && $$props.static) &&
|
!(features & Features.Static && $$props.static) &&
|
||||||
features & Features.RenderStrategy &&
|
features & Features.RenderStrategy &&
|
||||||
!unmount;
|
!unmount;
|
||||||
|
|
||||||
|
$: propsWeControl = {
|
||||||
|
class: computedClass,
|
||||||
|
style:
|
||||||
|
`${computedStyle ?? ""}${hidden ? " display: none" : ""}` || undefined,
|
||||||
|
};
|
||||||
|
$: if (propsWeControl.style === undefined) {
|
||||||
|
delete propsWeControl.style;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if show}
|
{#if show}
|
||||||
@@ -87,9 +96,7 @@
|
|||||||
bind:el
|
bind:el
|
||||||
use={[...use, forwardEvents]}
|
use={[...use, forwardEvents]}
|
||||||
{...$$restProps}
|
{...$$restProps}
|
||||||
class={computedClass}
|
{...propsWeControl}
|
||||||
style={`${computedStyle ?? ""}${hidden ? " display: none" : ""}` ||
|
|
||||||
undefined}
|
|
||||||
hidden={hidden || undefined}
|
hidden={hidden || undefined}
|
||||||
>
|
>
|
||||||
<slot />
|
<slot />
|
||||||
|
|||||||
Reference in New Issue
Block a user