This commit is contained in:
mdgriffith 2020-06-07 09:57:15 -04:00
commit 263e8fdd8a
2 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,28 @@
module LabelledInputAlignRight exposing (view)
import Testable.Element exposing (..)
import Testable.Element.Input as Input
view =
layout [] <|
column [ width fill ]
[ Input.text
[ width (px 200)
, alignRight
]
{ onChange = always False
, text = ""
, placeholder = Nothing
, label = Input.labelLeft [] (text "label")
}
, Input.text
[ width (px 200)
, alignRight
]
{ onChange = always False
, text = ""
, placeholder = Nothing
, label = Input.labelHidden "label"
}
]

View File

@ -0,0 +1,46 @@
module NearbyElementBordersOverlap exposing (view)
{-| Elements placed with onLeft, onRight, above & below overlap main element's border
# inFront elements with width fill are contained within the parent's border
<https://github.com/mdgriffith/elm-ui/issues/223>
In addition to the overlap, it affects layout in unexpected ways: eg if the elements
are the same height, onLeft and onRight elements will be vertically offset
from the main element.
-}
import Testable.Element exposing (..)
import Testable.Element.Border as Border
blue =
rgb 0 0 1
green =
rgb 0 1 0
grey =
rgb 0.5 0.5 0.5
view =
layout [ width fill, height fill ] <|
el
[ centerX
, centerY
, Border.width 10
, Border.color green
, padding 50
, above <| el [ Border.color grey, Border.width 10 ] <| text "above"
, below <| el [ Border.color grey, Border.width 10 ] <| text "below"
, onRight <| el [ Border.color blue, Border.width 10 ] <| text "onRight"
, onLeft <| el [ Border.color blue, Border.width 10 ] <| text "onLeft"
]
<|
text "Centre"