A popup <div> to pick from a list of choices.
See https://developer.mozilla.org/en-US/docs/Web/CSS/position for a description of the relevant CSS.
Make a bare-bones PopupPicker.
Args are renderChoice and wrapper properties.
Render the popup.
If the first arg is not Nothing, will call renderInputDiv to display it.
Sometimes you want to do this on mobile, when the type-in area may be covered
by the picker.
The generated Html is of the form:
div [ style "position" "absolute"
, divAttributes
, positionAttributes
]
[ header
, renderInputDiv input
, div [ onClick <| wrapper choice)>
, choiceAttributes
]
[ renderChoice choice ]
, ...
, footer
]positionAttributesposition (x, y) is the same as [ left x, top y ].
top x -> style "top" x
left x -> style "left" x
bottom x -> style "bottom x
right x -> style "right" x
Pass a larger integer than any other z-index to make the popup go on top.
This usually goes in the divAttributes property of your PopupPicker.
zIndex index -> style "z-index" <| String.fromInt index.
State passed to
view.divAttributesare added to the popup attributes for the wholediv.positionAttributesare additional attributes for the wholediv, usually generated byposition,top,left,bottom, orright.choiceAttributesare applied to thedivholding eachchoice.headeris put before the inputdivand thechoicedivs.renderInputDivrenders yourinput, if you pass one toview.renderChoicerenders each choice inside itsdiv.footeris put after thechoicedivs.wrappermaps a selected choice to amsgfor yourupdatefunction.