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.RenderStrategy &&
|
||||
!unmount;
|
||||
|
||||
$: propsWeControl = {
|
||||
class: computedClass,
|
||||
style:
|
||||
`${computedStyle ?? ""}${hidden ? " display: none" : ""}` || undefined,
|
||||
};
|
||||
$: if (propsWeControl.style === undefined) {
|
||||
delete propsWeControl.style;
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if show}
|
||||
@@ -87,9 +96,7 @@
|
||||
bind:el
|
||||
use={[...use, forwardEvents]}
|
||||
{...$$restProps}
|
||||
class={computedClass}
|
||||
style={`${computedStyle ?? ""}${hidden ? " display: none" : ""}` ||
|
||||
undefined}
|
||||
{...propsWeControl}
|
||||
hidden={hidden || undefined}
|
||||
>
|
||||
<slot />
|
||||
|
||||
Reference in New Issue
Block a user