Remove style attribute after remove float property if not styling left

This commit is contained in:
Henrik Giesel 2021-09-15 17:36:48 +02:00
parent 9b7ea75399
commit 9001b597da

View file

@ -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}</IconButton
>