From b469ddad903eda6823489d45ce51ad22dcede60d Mon Sep 17 00:00:00 2001 From: Amitai Burstein Date: Mon, 6 Nov 2023 22:10:12 +0200 Subject: [PATCH] Show fieldVaule on select list for existig records --- IHP/View/Form.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IHP/View/Form.hs b/IHP/View/Form.hs index f4023693a..072d67bfb 100644 --- a/IHP/View/Form.hs +++ b/IHP/View/Form.hs @@ -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)