editSharedSelectionWithShared not working as intended
- The options are shared but if the options are changed, the selector breaks, throws javascript errors and becomes unusable.
Less buggy, they could be features:
- When multiple selection is disallowed, it is still possible to do a multiple selection by changing the share containing the selection
- An invalid selection can be done by changing the share. E.g. item 6 can be selected when there are only 5.
With the following test program one can verify all the issues:
module test
import Data.Func, StdFunctions, iTasks
derive gDefault ChoiceNode
Start w = flip startEngine w $
withShared 5 \sharedInt->
withShared [] \sharedSel->
editSharedSelectionWithShared "test" False
(SelectInTree
(\l->[{defaultValue & id=i,label=toString i}\\i<-[0..l]])
(\_ s->s)
) sharedInt sharedSel
-|| updateSharedInformation "Number of items" [] sharedInt
-|| updateSharedInformation "Current selection" [] sharedSel
>&> viewSharedInformation "Current task value" [] o mapRead toSingleLineText