forked from unoplatform/uno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request unoplatform#14297 from Youssef1313/issues/14267
fix: Adjust TextBox ScrollViewer workaround for Material TextBox to wrap properly
- Loading branch information
Showing
5 changed files
with
171 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/TextBox_Wrapping.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<Page | ||
x:Class="Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml_Controls.TextBox_Wrapping" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml_Controls" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
|
||
<StackPanel> | ||
<StackPanel.Resources> | ||
<Style x:Key="TextBoxStyle" TargetType="TextBox"> | ||
<Setter Property="HorizontalContentAlignment" Value="Left" /> | ||
<Setter Property="VerticalContentAlignment" Value="Center" /> | ||
|
||
|
||
<Setter Property="MinHeight" Value="58" /> | ||
|
||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="TextBox"> | ||
<Grid x:Name="Root" | ||
Background="{TemplateBinding Background}" | ||
CornerRadius="{TemplateBinding CornerRadius}" | ||
Padding="{TemplateBinding Padding}"> | ||
|
||
<ScrollViewer x:Name="ContentElement" | ||
Background="Red" | ||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" | ||
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" | ||
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" | ||
IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" | ||
IsTabStop="False" | ||
IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" | ||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" | ||
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" | ||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" | ||
ZoomMode="Disabled" | ||
AutomationProperties.AccessibilityView="Raw"> | ||
</ScrollViewer> | ||
|
||
</Grid> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
</StackPanel.Resources> | ||
<StackPanel Margin="10" VerticalAlignment="Center" Width="200"> | ||
<TextBox AutomationProperties.AutomationId="NewTextBox" | ||
x:Name="SUT" | ||
x:FieldModifier="public" | ||
AcceptsReturn="True" | ||
IsSpellCheckEnabled="True" | ||
Margin="0,10" | ||
MaxLength="500" | ||
PlaceholderText="Enter text here" | ||
Style="{StaticResource TextBoxStyle}" | ||
TextWrapping="Wrap" /> | ||
</StackPanel> | ||
</StackPanel> | ||
</Page> |
11 changes: 11 additions & 0 deletions
11
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Controls/TextBox_Wrapping.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Windows.UI.Xaml.Controls; | ||
|
||
namespace Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml_Controls; | ||
|
||
public sealed partial class TextBox_Wrapping : Page | ||
{ | ||
public TextBox_Wrapping() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters