Skip to content
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

[WASM] TextBox has a different behavior with winui when set a style for it #19106

Open
SongOfYouth opened this issue Dec 19, 2024 · 0 comments
Open
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification

Comments

@SongOfYouth
Copy link

Current behavior

TextBox on wasm dosn't get the winui style when set a style for it like:

  <Page.Resources>
    <Style TargetType="TextBox">
      <Setter Property="Margin" Value="8"/>
    </Style>
  </Page.Resources>

Expected behavior

keep pace with winui

How to reproduce it (as minimally and precisely as possible)

No response

Workaround

let the custom style based on DefaultTextBoxStyle:

  <Page.Resources>
    <Style TargetType="TextBox" BasedOn="{StaticResource DefaultTextBoxStyle}">
      <Setter Property="Margin" Value="8"/>
    </Style>
  </Page.Resources>

Works on UWP/WinUI

None

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

Uno.Sdk: 5.5.54

Affected platforms

WebAssembly

IDE

Visual Studio 2022

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

I think it has to be fix because:

  1. we don't need do it with default style on winui;
  2. we may not know which style we should inherit from, maybe not the default;
  3. sometimes, we want to set styles for all FrameworkElement to make them have a consistent margin or else.
@SongOfYouth SongOfYouth added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification
Projects
None yet
Development

No branches or pull requests

1 participant