diff --git a/yesod-form/ChangeLog.md b/yesod-form/ChangeLog.md index 9441bc049..ece605124 100644 --- a/yesod-form/ChangeLog.md +++ b/yesod-form/ChangeLog.md @@ -1,5 +1,9 @@ # ChangeLog for yesod-form +## 1.7.2 + +* Added `withRadioField` and re-express `radioField` into that. [#1775](https://github.com/yesodweb/yesod/pull/1775) + ## 1.7.1 * Added `colorField` for creating a html color field (``) [#1748](https://github.com/yesodweb/yesod/pull/1748) diff --git a/yesod-form/Yesod/Form/Fields.hs b/yesod-form/Yesod/Form/Fields.hs index f5812d736..7cbd34543 100644 --- a/yesod-form/Yesod/Form/Fields.hs +++ b/yesod-form/Yesod/Form/Fields.hs @@ -49,6 +49,7 @@ module Yesod.Form.Fields , selectFieldListGrouped , radioField , radioFieldList + , withRadioField , checkboxesField , checkboxesFieldList , multiSelectField @@ -530,26 +531,50 @@ checkboxesField ioptlist = (multiSelectField ioptlist) radioField :: (Eq a, RenderMessage site FormMessage) => HandlerFor site (OptionList a) -> Field (HandlerFor site) a -radioField = selectFieldHelper - (\theId _name _attrs inside -> [whamlet| -$newline never -
^{inside} -|]) - (\theId name isSel -> [whamlet| +radioField = withRadioField + (\theId optionWidget -> [whamlet| $newline never