Commit e745f6a2 authored by Steffen Michels's avatar Steffen Michels

selection controls: assume empty selection if selection given by onRefresh is out of bounds

parent c309d1a9
Pipeline #28971 passed with stage
in 4 minutes and 28 seconds
......@@ -206,12 +206,14 @@ where
onRefresh dp (newVal, newSel) (mbOldVal, oldSel, multiple) vst
//Check options
# oldOpts = mbValToOptions mbOldVal
# newOpts = mbValToOptions $ Just newVal
# cOptions = if (newOpts =!= oldOpts)
(ChangeUI [SetAttribute "options" (JSONArray newOpts)] [])
# oldOptsJson = mbValToOptions mbOldVal
# newOpts = getOptions newVal
# newOptsJson = toOption <$> newOpts
# cOptions = if (newOptsJson =!= oldOptsJson)
(ChangeUI [SetAttribute "options" (JSONArray newOptsJson)] [])
NoChange
//Check selection
//Check selection, if the selection is out of bounds assume the empty selection
# newSel = if (all (checkBounds newOpts) newSel) newSel []
# cSel = if (newSel =!= oldSel) (ChangeUI [SetAttribute "value" (toJSON newSel)] []) NoChange
= (Ok (mergeUIChanges cOptions cSel, (Just newVal, newSel, multiple)),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