Here’s a are a case for changing the TextInput.IsPassword
property on the fly and just getting the first change made. The button’s text is changing and the console shows the value changed correctly. What could it be?
<App>
<JavaScript>
var Observable = require('FuseJS/Observable');
var textPassword = Observable("");
var textShowPassword = Observable("Show");
var showPassword = Observable(true);
module.exports = {
textPassword : textPassword,
textShowPassword : textShowPassword,
onShowPassword : function onShowPassword() {
showPassword.value = !showPassword.value;
textShowPassword.value = showPassword.value ? "Show" : "Hide";
}
}
</JavaScript>
<TextInput
ux:Class="_TextInput"
HitTestMode="LocalBoundsAndChildren"
Height="20"
FontSize="14">
<Clicked>
<GiveFocus Target="this" />
</Clicked>
<WhileFocused>
<Rectangle Dock="Bottom" Fill="#5184e5" Height="1" />
</WhileFocused>
<WhileNotFocused>
<Rectangle Dock="Bottom" Fill="#ddd" Height="1" />
</WhileNotFocused>
</TextInput>
<StackPanel Margin="20">
<Text FontSize="10" Value="PASSWORD"
TextAlignment="Left" Margin="0,0,0,10" TextColor="#b1b1b1"/>
<Panel Alignment="Top" HitTestMode="LocalVisualAndChildren">
<_TextInput ux:Name="TextPassword" Alignment="VerticalCenter" MaxLength="15"
FontSize="18" IsPassword="true" Value="{textPassword}"
TextWrapping="Wrap" ActionStyle="Next"/>
<Button ux:Name="ButtonShowPassword" Alignment="Right" ZOffset="1">
<Text ux:Name="TextShowPassword" Value="{textShowPassword}" TextColor="#b1b1b1" FontSize="10"
TextAlignment="Right" Alignment="Right">
</Text>
<Clicked>
<Callback Handler="{onShowPassword}" />
<Set Target="TextPassword.IsPassword" Value="{showPassword}"/>
</Clicked>
</Button>
</Panel>
</StackPanel>
</App>