# Deactivate WhileSelected

**URL:** <https://forums.fusetools.com/t/deactivate-whileselected/7196>\
**Category:** How-to Discussions\
**Created:** [May 21, 2018, 10:31pm UTC](https://forums.fusetools.com/t/deactivate-whileselected/7196 "2018-05-21T22:31:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin\_Byrne](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@Colin\_Byrne](https://forums.fusetools.com/u/Colin_Byrne)\
**Post date:** [May 21, 2018, 10:31pm UTC](https://forums.fusetools.com/t/deactivate-whileselected/7196/1 "2018-05-21T22:31:30Z")

</div>

Hi there,  
What is the best way to (programmatically) deactivate the WhileSelected on an item that has been selected?  
Playing around with the following code, I would like to be able to have a reset button on the form that resets the WhileSelected via JavaScript. Is this possible?  
Thanks.

```auto
<App Background="#222">
<Panel ux:Class="MyItem" Color="#aaa">
	<string ux:Property="Label" />
	<string ux:Property="Value" />
	
	<Selectable Value="{ReadProperty this.Value}" />
	<Text Value="{ReadProperty this.Label}" />
	
	<WhileSelected>
		<Change this.Color="#ffc" />
	</WhileSelected>
	<Tapped>
		<ToggleSelection />
	</Tapped>
</Panel>

```

```auto
<JavaScript>
	var Observable = require("FuseJS/Observable");

	var values = Observable();
	var list = Observable(function() {
		return values.toArray().join(",");
	});

	module.exports = {
		values: values,
		list: list
	};
</JavaScript>

<StackPanel>
	<Selection Values="{values}" />

	<MyItem Label="Big Red One" Value="sku-01" />
	<MyItem Label="Small Green Two" Value="sku-02" />
	<MyItem Label="Third Last One" Value="sku-03" />
	<MyItem Label="Four Fore For" Value="sku-04" />
	<MyItem Label="Point Oh-Five" Value="sku-05" />

	<Text Value="Selected:" Margin="0,10,0,0" />
	<Text Value="{list}" />
</StackPanel>
</App>

```

---

<div class="post-metadata">

**Author:** ![Arturs](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/arturs/32/582_2.png) [@Arturs](https://forums.fusetools.com/u/Arturs)\
**Post date:** [May 22, 2018, 5:26am UTC](https://forums.fusetools.com/t/deactivate-whileselected/7196/2 "2018-05-22T05:26:23Z")

</div>

Hey @Colin_Byrne

Maybe [this](https://forums.fusetools.com/t/set-the-dropdownlist-to-not-selected/4211) forum thread will help you.

---

<div class="post-metadata">

**Author:** ![Colin\_Byrne](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@Colin\_Byrne](https://forums.fusetools.com/u/Colin_Byrne)\
**Post date:** [May 22, 2018, 9:04am UTC](https://forums.fusetools.com/t/deactivate-whileselected/7196/3 "2018-05-22T09:04:10Z")

</div>

Hi @Arturs.  
Thanks for the reply. I will have a look at this and see if I can come up with a workaround for WhileSelected trigger. I will post here if I work it out.  
Thanks again.
