# How to disable router When BackButton is Clicked?

**URL:** <https://forums.fusetools.com/t/how-to-disable-router-when-backbutton-is-clicked/541>\
**Category:** How-to Discussions\
**Created:** [May 21, 2017, 7:16pm UTC](https://forums.fusetools.com/t/how-to-disable-router-when-backbutton-is-clicked/541 "2017-05-21T19:16:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhguswns23](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@dhguswns23](https://forums.fusetools.com/u/dhguswns23)\
**Post date:** [May 21, 2017, 7:16pm UTC](https://forums.fusetools.com/t/how-to-disable-router-when-backbutton-is-clicked/541/1 "2017-05-21T19:16:10Z")

</div>

How can I disable router, when the back button is clicked during some status, is true?  
I tried [this page](https://www.fusetools.com/community/forums/howto_discussions/router_backbutton?page=1&highlight=33e09860-8549-4a92-a409-5fc6fb56c014) to fix up what I mentioned above, but it is still activated when the back button is clicked.

Below are what I tried and if you need any more code which I tried to solve this problem, please let me know.

```auto
<StackPanel Padding="0" Dock="Bottom" ux:Name="RegionSelectPanel" Height="420">
	...	
	<WhileFalse Value="{regionSelectVisible}" ux:Name="RegionSelectorStatus">
		<Change RegionSelectPanel.Height="0" EasingBack="QuarticIn" Duration="0.6" DurationBack="0.9"/>
	</WhileFalse>
	<WhileTrue Value="{regionSelectVisible}">
		<OnBackButton>
			<Set RegionSelectorStatus.Value="false"/>
		</OnBackButton>
	</WhileTrue>
</StackPannel>

```

```auto
<Page>
        ...
        <WhileFalse Value="{regionSelectVisible}">
                <OnBackButton Handler="{handleGoBack}" />
        </WhileFalse>
</Page>

```

```auto
function toggleRegionPanel(){
	regionSelectVisible.value = !regionSelectVisible.value;
}
function handleGoBack(){
	router.goBack();
	console.log('goback!');
}

```

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [May 22, 2017, 7:45am UTC](https://forums.fusetools.com/t/how-to-disable-router-when-backbutton-is-clicked/541/2 "2017-05-22T07:45:50Z")

</div>

Hi dhguswns23,

it’s not clear what you mean by _disable router_. You might want to rephrase your question.

If you’re asking if there is a way to _not react on hardware back button pressed_, then your approach with wrapping `OnBackButton` inside of a `WhileTrue`/`WhileFalse` seems to be correct.

However, those code snippets help very little - you need to make a minimal, self-contained reproduction (“copy-paste and run” single-UX-file app) and someone will give that a go.
