Skip to content

Commit

Permalink
More comment
Browse files Browse the repository at this point in the history
  • Loading branch information
amitaibu committed Sep 16, 2023
1 parent ba6016c commit 9e8f14b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions IHP/View/Form.hs
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,7 @@ selectField field items = FormField
-- way they have to select for a reference field.
-- So we check if the model is new and the field was not submitted yet, then we set the
-- field value to an empty string. Otherwise, we use the value from the model.
-- If the select field is empty, then the param would be empty as well.
fieldValue = if isNew model && null (paramList @Text (cs fieldName))
then ""
else inputValue (getField @fieldName model :: SelectValue item)
Expand Down

0 comments on commit 9e8f14b

Please sign in to comment.