Skip to content

Commit

Permalink
Show fieldVaule on select list for existig records
Browse files Browse the repository at this point in the history
  • Loading branch information
amitaibu authored and mpscholten committed Nov 6, 2023
1 parent dac48f2 commit 8fa88fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion IHP/View/Form.hs
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ selectField field items = FormField
-- If the field is not touched, we don't want to render the value from the model
-- so we force the user to select. If a value was explicitely set in the model, we
-- render that value.
, fieldValue = if IHP.ModelSupport.didTouchField field model
, fieldValue = if IHP.ModelSupport.didTouchField field model || (not $ isNew model)
then inputValue (getField @fieldName model :: SelectValue item)
else ""
, fieldInputId = cs (lcfirst (getModelName @model) <> "_" <> cs fieldName)
Expand Down

0 comments on commit 8fa88fe

Please sign in to comment.