-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HintAssist.Hint text is cut-off #3124
Comments
@reyntjesr Judging from your screenshots, it seems to me that the width of the Could you share the XAML that lays out these text boxes so I can see if I can spot the issue there? The bugs you link to have been fixed by refactoring the hint/helper placements somewhat, and that can potentially be what you're experiencing now. |
The textboxes are in a ReactiveUI usercontrol. The xaml of this UserControl you see below. The usercontrol:
The shared xaml file:
|
@reyntjesr The <Grid Margin="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Text="{x:Static Properties:Resources.SelectedFiles}"/>
<ItemsControl Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" ItemsSource="{Binding Files}" VerticalAlignment="Top"/>
<TextBox Grid.Row="2" Grid.Column="0" x:Name="labAssInitials" materialDesign:HintAssist.Hint="{Binding LabAssistantInitialsText}"
Text="{Binding CurrentExtraInfo.LabAssistantInitials, UpdateSourceTrigger=PropertyChanged}"/>
<TextBox Grid.Row="3" Grid.Column="0" x:Name="physAssInitials" materialDesign:HintAssist.Hint="{Binding PhysAssistantInitialsText}"
Text="{Binding CurrentExtraInfo.PhysAssistantInitials, UpdateSourceTrigger=PropertyChanged}"/>
<TextBox Grid.Row="4" Grid.Column="0" x:Name="physicianInitials" materialDesign:HintAssist.Hint="{Binding PhysicianInitialsText}"
Text="{Binding CurrentExtraInfo.PhysicianInitials, UpdateSourceTrigger=PropertyChanged}"/>
<TextBox Grid.Row="5" Grid.Column="0" x:Name="remarks" materialDesign:HintAssist.Hint="{x:Static Properties:Resources.Remarks}"
TextWrapping="Wrap" AcceptsReturn="True">
<TextBox.Text>
<Binding Path="CurrentExtraInfo.Remarks" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
</Binding>
</TextBox.Text>
</TextBox>
<Button Grid.Row="6" Grid.Column="0" Content="Resend files"
HorizontalAlignment="Left"
Command="{Binding Path=ResendFilesCommand}"
Height="25" Width="Auto" Padding="10,1,10,1"
Visibility="Collapsed"></Button>
</Grid> Firstly, it defines 2 columns which are both set to auto-size (i.e.
I think you should set |
Thanks for your help! As I said I, have this issue with all the textboxes in the three programs I'm developing and also when I change the TextBox style from MaterialDesignFloatingHintTextBox to MaterialDesignOutlinedTextBox or MaterialDesignFilledTextBox. So in my programs the width of the textbox of materialdesignthemes versions higher than 4.6.1 only depend on the width of the Text field and not on the HintAssist.Hint width anymore. |
@reyntjesr The If setting the column to "*" does not solve your issue, then you have a similar issue further up the visual tree. In the code below I have - for demonstration purposes - hardcoded the width of a <Grid Width="300" Background="LightGreen">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="Some TextBlock" Grid.Column="0" Grid.ColumnSpan="2" Margin="5" />
<TextBox Grid.Column="0" Grid.Row="1" materialDesign:HintAssist.Hint="Short hint" Margin="5" />
<TextBox Grid.Column="0" Grid.Row="2" materialDesign:HintAssist.Hint="A longer hint text" Margin="5" />
</Grid> So either you need to adjust the |
Of course the size of the textbox should depend on the size of the hint. The hint gives information about what should be filled in the textbox. Is there anyone who only wants to show half the hint? As I said I have several programs that all use a lot of textboxes. I have to manually set a MinWidth on all of them now. And when I change the program to another language I have to check for text cut-offs again. |
I disagree. The hint is optional extra information. Also, once you start typing anything in the If you really want your hint/helper to be the determining factor for the
To me, this sound like a more general layout issue in your application. If you allow everything in your visual tree to "size to content", I think you're asking for trouble. Also, setting
On this point we somewhat agree. I would expect the complete hint to be shown if there is room for it in the space reserved for the |
I think both views have merit. But the main problem is that the behavior changed. Before the TextBox would show the hint, now it's cut off. If you update to the latest version, you suddenly encounter this issue. That should probably be mentioned as a breaking change somewhere. |
@Tokter I do agree that both views have merit. Especially the translations scenario. Thus I will create a new draft PR to work on a solution that handles this better. Regarding your comment on the breaking (visual) change. This was actually marked in all of the PRs (#3074, #3086, and #3056) and actually also mentioned in the 4.8.0 release notes, albeit without a whole lot of detail about HOW it was visually breaking. |
Bug explanation
I am currently stuck to version 4.6.1 of materialdesignthemes. This is how my
textboxes with MaterialDesignFloatingHintTextBox Style look now.
If I try to upgrade to a later version than 4.6.1 the HintAssist.Hint texts is cut-off
I didn't change the MaterialDesignFloatingHintTextBox style in the example above much. The problem persists if I use the standard MaterialDesignFloatingHintTextBox style.
The problem looks a bit like these issues, but these are closed:
#3055
#2686
Version
4.6.1
The text was updated successfully, but these errors were encountered: