💀 remove noOpMsg

This commit is contained in:
Tessa Kelly 2019-04-03 17:17:36 -07:00
parent 306e414514
commit 1d51b1c659
3 changed files with 7 additions and 17 deletions

View File

@ -6,6 +6,11 @@ module Nri.Ui.Checkbox.V5 exposing
{-|
# Changes from V5:
- Removes `noOpMsg` from Model
@docs Model, Theme, IsSelected
@docs view, viewWithLabel, Assets
@ -41,7 +46,6 @@ type alias Model msg =
, selected : IsSelected
, disabled : Bool
, theme : Theme
, noOpMsg : msg
}
@ -265,11 +269,8 @@ viewCheckbox model config =
]
, config.containerClasses
, Attributes.id <| model.identifier ++ "-container"
, -- This is necessary to prevent event propagation.
-- See https://github.com/elm-lang/html/issues/96
Attributes.map (always model.noOpMsg) <|
Events.stopPropagationOn "click"
(Json.Decode.succeed ( "stop click propagation", True ))
, Events.stopPropagationOn "click"
(Json.Decode.fail "stop click propagation")
]
[ Html.checkbox model.identifier
(selectedToMaybe model.selected)

View File

@ -30,7 +30,6 @@ type alias PremiumConfig msg =
, pennant : Maybe Pennant
, onChange : Bool -> msg
, onLockedClick : msg
, noOpMsg : msg
}
@ -69,7 +68,6 @@ premium assets config =
else
Checkbox.Square
, noOpMsg = config.noOpMsg
}
, case config.pennant of
Just pennant ->

View File

@ -94,7 +94,6 @@ viewInteractableCheckbox id state =
, selected = isSelected id state
, disabled = False
, theme = Checkbox.Square
, noOpMsg = NoOp
}
@ -108,7 +107,6 @@ viewIndeterminateCheckbox id state =
, selected = Checkbox.PartiallySelected
, disabled = True
, theme = Checkbox.Square
, noOpMsg = NoOp
}
@ -122,7 +120,6 @@ viewLockedOnInsideCheckbox id state =
, selected = Checkbox.NotSelected
, disabled = True
, theme = Checkbox.Locked
, noOpMsg = NoOp
}
@ -136,7 +133,6 @@ viewDisabledCheckbox id state =
, selected = isSelected id state
, disabled = True
, theme = Checkbox.Square
, noOpMsg = NoOp
}
@ -153,7 +149,6 @@ viewMultilineCheckboxes =
, selected = Checkbox.NotSelected
, disabled = False
, theme = Checkbox.Square
, noOpMsg = NoOp
}
, Checkbox.viewWithLabel
assets
@ -163,7 +158,6 @@ viewMultilineCheckboxes =
, selected = Checkbox.PartiallySelected
, disabled = True
, theme = Checkbox.Square
, noOpMsg = NoOp
}
, Checkbox.viewWithLabel
assets
@ -173,7 +167,6 @@ viewMultilineCheckboxes =
, selected = Checkbox.NotSelected
, disabled = True
, theme = Checkbox.Locked
, noOpMsg = NoOp
}
, Checkbox.viewWithLabel
assets
@ -183,7 +176,6 @@ viewMultilineCheckboxes =
, selected = Checkbox.NotSelected
, disabled = True
, theme = Checkbox.Square
, noOpMsg = NoOp
}
]
@ -207,7 +199,6 @@ viewPremiumCheckboxes state =
, pennant = config.pennant
, onChange = ToggleCheck config.label
, onLockedClick = NoOp
, noOpMsg = NoOp
}
in
Html.div []