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 · 2 comments
Open
Labels
difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working project/styling 👔 Categorizes an issue or PR as relevant to element styling

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
@MartinZikmund
Copy link
Member

To be clear, the style in WinUI remains "fluent" (rounded corners, etc) while in Uno it becomes plain with sharp corners, correct?

@MartinZikmund MartinZikmund added project/styling 👔 Categorizes an issue or PR as relevant to element styling difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI and removed triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Jan 2, 2025
@SongOfYouth
Copy link
Author

To be clear, the style in WinUI remains "fluent" (rounded corners, etc) while in Uno it becomes plain with sharp corners, correct?

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working project/styling 👔 Categorizes an issue or PR as relevant to element styling
Projects
None yet
Development

No branches or pull requests

2 participants