Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions src/ShadUI/Controls/TextBox/TextBox.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,22 +132,26 @@
<Setter Property="shadui:ControlAssist.MinHeight" Value="36" />
<Setter Property="Template">
<ControlTemplate>
<StackPanel Background="Transparent" Focusable="False">
<!-- Use Grid instead of StackPanel so content can stretch to fill available height -->
<Grid Background="Transparent" Focusable="False" RowDefinitions="Auto,*">
<TextBlock
Grid.Row="0"
Classes="Small"
Cursor="Arrow"
IsVisible="{TemplateBinding UseFloatingWatermark}"
Margin="0,0,0,6"
Name="PART_Label"
Text="{TemplateBinding Watermark}" />
<DataValidationErrors Focusable="False">
<StackPanel>
<DataValidationErrors Grid.Row="1" Focusable="False">
<!-- Use Grid instead of StackPanel so Border can stretch to fill available height -->
<Grid RowDefinitions="*,Auto">
<Border
Grid.Row="0"
VerticalAlignment="Stretch"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
Height="{TemplateBinding shadui:ControlAssist.Height}"
MinHeight="{TemplateBinding shadui:ControlAssist.MinHeight}"
Name="Border">
<Grid ColumnDefinitions="Auto * Auto">
Expand Down Expand Up @@ -241,16 +245,17 @@
</Grid>
</Border>
<TextBlock
Grid.Row="1"
Classes="Caption Muted"
Cursor="Arrow"
IsVisible="{TemplateBinding shadui:ControlAssist.Hint,
Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
Margin="0,4,0,0"
Name="Hint"
Text="{TemplateBinding shadui:ControlAssist.Hint}" />
</StackPanel>
</Grid>
</DataValidationErrors>
</StackPanel>
</Grid>
</ControlTemplate>
</Setter>

Expand Down Expand Up @@ -283,7 +288,7 @@
</Style>
</Style>

<Style Selector="^ /template/ StackPanel">
<Style Selector="^ /template/ Grid">
<Setter Property="Cursor" Value="IBeam" />
</Style>
<Style Selector="^:disabled /template/ Border#Border">
Expand Down