Reset Selection tags in the multi-state box

Hi there!

You can accomplish this in two ways.

Method 1: Making the currently selected tag (on every state) null as soon as you save the selection in the keywordsArray.

This uses SelectionTags.selectedIndices property

Here’s a example:

Original Code:

$w('#whoTags').onChange(event => {
        keywordsArray.push(event.target.value[0]);
        $w('#quizStates').changeState('whatState');
});

Updated code:

$w('#whoTags').onChange(event => {
        keywordsArray.push(event.target.value[0]);
        $w("#whoTags").selectedIndices = null;
        $w('#quizStates').changeState('whatState');
});

This will prevent the “Selected” style from showing if you reset the quiz.

Method 2: Changing the design of the “Selected” state for the Selection Tags in the editor.

If you are not using the “Selected” style for any ux purpose, changing the style to match the default color would also prevent the previously selected choices from being visible.