Fix padding override issue

This commit is contained in:
Matthew Griffith 2024-06-23 15:43:48 -04:00
parent df1b3d004b
commit b7f6e7ac82

View File

@ -16,7 +16,6 @@ import Internal.Teleport as Teleport
import Json.Decode as Json
import Json.Encode as Encode
import Set exposing (Set)
import Task
import Time
import VirtualDom
@ -1403,6 +1402,15 @@ fontSizeAdjusted size height =
toFloat size * (1 / height)
isSkippable : Flag -> Bool
isSkippable bits =
-- We skip padding here as well because
-- 1. it's supposed to accumulate, e.g. you set padding-left/padding-right and they should stack
-- 2. But we can't use `skip` because we want to identify stuff by flag
-- to pull it out to use in multiline inputs. See Ui.Input.multiline
BitField.fieldEqual bits Flag.skip || BitField.fieldEqual bits Flag.padding
{-|
1. What nodes are we rendering?
@ -1437,7 +1445,7 @@ analyze has encoded inheritance attrs =
-- 1. it's supposed to accumulate, e.g. you set padding-left/padding-right and they should stack
-- 2. But we can't use `skip` because we want to identify stuff by flag
-- to pull it out to use in multiline inputs. See Ui.Input.multiline
if BitField.fieldEqual flag Flag.skip || BitField.fieldEqual flag Flag.padding then
if isSkippable flag then
False
else
@ -1480,7 +1488,7 @@ toAttrs parentBits myBits has htmlAttrs attrs =
(Attribute { flag, attr }) :: remain ->
let
previouslyRendered =
if BitField.fieldEqual flag Flag.skip then
if isSkippable flag then
False
else
@ -1587,7 +1595,7 @@ toStyle parentBits myBits analyzedBits has htmlAttrs classes attrs =
(Attribute { flag, attr }) :: remain ->
let
previouslyRendered =
if BitField.fieldEqual flag Flag.skip then
if isSkippable flag then
False
else
@ -1659,7 +1667,7 @@ toStyleAsEncodedProperty parentBits myBits analyzed has classesString htmlAttrs
(Attribute { flag, attr }) :: remain ->
let
previouslyRendered =
if BitField.fieldEqual flag Flag.skip then
if isSkippable flag then
False
else