Skip to content

Fluent controls don't respect BorderThickness set to 0 #7621

Closed

Description

@robloo

Current behavior

Using the Fluent version 2 Style on TextBox, it is impossible to set BorderThickness to zero and have the border disappear. Consider the following code:

        <TextBox
            x:Name="SettingsSidePaneTitleTextBox"
            PlaceholderText="Title"
            Background="Transparent"
            BorderThickness="0"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Top"
            Margin="5" />

Produces (on Android):

Unfocused
image

Keyboard Focused

image

Expected behavior

UWP:

Unfocused
image

Keyboard Focused
image

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

See the repro app:
TestApp.zip

Workaround

None

Works on UWP/WinUI

Yes

Environment

Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia

NuGet package version(s)

4.0.9

Affected platforms

Android

IDE

Visual Studio 2022

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

Activity

  1. added
    difficulty/tbd
    kind/bug
    triage/untriaged
    on Dec 8, 2021
  2. robloo commented on Dec 10, 2021

    @robloo
    ContributorAuthor

    @MartinZikmund You implemented the new Fluent v2 borders for Android I believe. Do you expect this is an easy fix? Can you point in the right direction?

  3. MartinZikmund commented on Dec 10, 2021

    @MartinZikmund
    Member

    Workaround here would be to create a custom Style for Button to hide the border, but proper fix will require adjusting the customized template. I can look into this after I finish my current task

  4. robloo commented on Dec 10, 2021

    @robloo
    ContributorAuthor

    No rush, I was under the impression the linear gradient borders required some larger work-arounds to get working. If it was just some tweaks to the template this should be quickly solvable.

  5. MartinZikmund commented on Dec 10, 2021

    @MartinZikmund
    Member

    We were (and still are) aiming for a full workaround-less implementation for linear gradient borders (Android, iOS, macOS and Skia are actually basically ready in this regard), but getting it working on WASM is super tricky, as gradients don't play nice with corner radius, so that's why we went with this simpler solution for now until we find a reliable solution on web

  6. added
    difficulty/starter 🚀
    project/styling 👔
    and removed
    difficulty/tbd
    triage/untriaged
    on Dec 11, 2021
  7. added
    difficulty/challenging 🤯
    and removed
    difficulty/starter 🚀
    on Jul 19, 2023
  8. changed the title [-]Fluent v2 TextBox doesn't respect BorderThickness set to Zero[/-] [+]Fluent controls don't respect `BorderThickness` set to 0[/+] on Sep 5, 2023
  9. MartinZikmund commented on Sep 5, 2023

    @MartinZikmund
    Member

    This applies to other controls like Button too (#13348)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

difficulty/challenging 🤯kind/bugproject/styling 👔

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions