Open benjaminweb opened 4 weeks ago
We try to put these actions as arguments to a view function (rather than a Mod
), because the views carry the view id type: View viewId ()
For example, here is button
button :: HyperView id => Action id -> Mod -> View id () -> View id ()
Can you give me a specific example here so we can think about how best to solve it? Is there a "view" analogous to button
that we could create to handle this? Or is it more like onLoad
, which wraps views?
contactView :: User -> View Contact ()
contactView u = do
col (pad 10 . gap 10) $ do
target Contacts $ hover (ShowUid u.id) $ do
row fld $ do
el id (text "First Name:")
text u.firstName
button
is an onClick event.
hover
then is just an onHover event.
target maps it to the corresponding ViewId
.
Though, the specific event types might be differentiated out a little more like Elm does like onMouseEnter
or onMouseLeave
.
Is that what you had in mind as an example? Does that help?
Requirement: Update any view on onHover over specific element.
Web.View
's hover does only apply to styles.What would be the interface to call it? Another handler?