File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
src/MaterialDesignThemes.Wpf
tests/MaterialDesignThemes.UITests/WPF/TextBoxes Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,8 @@ private void RefreshState(bool useTransitions)
253253 if ( proxy is null ) return ;
254254 if ( ! proxy . IsVisible ) return ;
255255
256+ IsContentNullOrEmpty = proxy . IsEmpty ( ) ;
257+
256258 var action = new Action ( ( ) =>
257259 {
258260 string state = string . Empty ;
Original file line number Diff line number Diff line change @@ -585,6 +585,33 @@ await Wait.For(async() =>
585585
586586 recorder . Success ( ) ;
587587 }
588+
589+ [ Test ]
590+ [ Description ( "Issue 3914" ) ]
591+ public async Task TextBox_ClearButtonRemainsHidden_WhenInitiallyCollapsedAndMadeVisible ( )
592+ {
593+ await using var recorder = new TestRecorder ( App ) ;
594+
595+ var grid = await LoadXaml < Grid > ( $ """
596+ <Grid Margin="30">
597+ <TextBox Visibility="Collapsed"
598+ VerticalAlignment="Center"
599+ materialDesign:TextFieldAssist.HasClearButton="True">
600+ </TextBox>
601+ </Grid>
602+ """ ) ;
603+
604+ var textBox = await grid . GetElement < TextBox > ( "/TextBox" ) ;
605+
606+ await textBox . SetVisibility ( Visibility . Visible ) ;
607+
608+ var clearButton = await grid . GetElement < Button > ( "PART_ClearButton" ) ;
609+ Visibility clearButtonVisibility = await clearButton . GetVisibility ( ) ;
610+
611+ await Assert . That ( clearButtonVisibility ) . IsEqualTo ( Visibility . Collapsed ) ;
612+
613+ recorder . Success ( ) ;
614+ }
588615}
589616
590617public class NotEmptyValidationRule : ValidationRule
You can’t perform that action at this time.
0 commit comments