From 9001b597da24e4d9a8f0d4117b392eb44c27bba7 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Wed, 15 Sep 2021 17:36:48 +0200 Subject: [PATCH] Remove style attribute after remove float property if not styling left --- ts/editor/ImageHandleFloatButtons.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ts/editor/ImageHandleFloatButtons.svelte b/ts/editor/ImageHandleFloatButtons.svelte index 2d221f0a6..4936a2df3 100644 --- a/ts/editor/ImageHandleFloatButtons.svelte +++ b/ts/editor/ImageHandleFloatButtons.svelte @@ -41,7 +41,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html active={image.style.float === "" || image.style.float === "none"} flipX={isRtl} on:click={() => { - image.style.float = ""; + image.style.removeProperty("float"); + + if (image.getAttribute("style")?.length === 0) { + image.removeAttribute("style"); + } + setTimeout(() => dispatch("update")); }}>{@html floatNoneIcon}