Commit 1a0772c5 authored by Steffen Michels's avatar Steffen Michels

fix bug in onEdit for controls: the new value should not be set on the client...

fix bug in onEdit for controls: the new value should not be set on the client (this can overwrite a new value entered before the event is processed by the client)
parent d1454313
......@@ -153,11 +153,11 @@ where
]
= (Ok (uia type attr, (mbVal, attr)), vst)
onEdit _ (_, mbVal) (_, attrs) vst = (Ok (ChangeUI [SetAttribute "value" valJSON] [], (mbVal`, attrs)), vst)
onEdit _ (_, mbVal) (_, attrs) vst = (Ok (NoChange, (mbVal`, attrs)), vst)
where
(mbVal`, valJSON) = case mbVal of
Just val | isValid attrs val = (Just val, toJSON val)
_ = (Nothing, JSONNull)
mbVal` = case mbVal of
Just val | isValid attrs val = Just val
_ = Nothing
onRefresh toJSON dp new (mbOld, attrs) vst
| mbOld === Just new = (Ok (NoChange, (mbOld, attrs)), vst)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment