Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] When changing the Style of the Label at runtime, TextDecorations property setting in Style not working #9110

Open
syncsiva opened this issue Jan 7, 2020 · 10 comments

Comments

@syncsiva
Copy link
Contributor

syncsiva commented Jan 7, 2020

Description

When changing the Style of the Label at runtime, TextDecorations property setting in Style not working.

Steps to Reproduce

Sample
styling-issue.zip

  1. Run the below sample.
  2. Click the Change Style button.
  3. You can see "No Style Applied" text of label gets changed to "Style1 Applied". Also text color changed to red.
  4. Now again click the button to apply style2. Now, label text gets changes to "Style2 Applied" and text color changed to green. In addition to that text underlined since TextDecorations set as Underline.
  5. Now again click the button to apply styl1. Now label text and color changed. But Underline is no removed which is applied via Style2.

The above one is the basic use case. I have reproduced the issue since we have faced issue with SfListView of Syncfusion. In the same attached sample, Style1 applied for a level inside ListView ItemTemplate if contactname is kyle and style2 applied otherwise. But TextDecoration alone not updated when scrolling the SfListView.
Note: I have tested the same against Xamarin.Forms CollectionView and it worked with Xamarin.Forms CollectionView.

Test in UWP and Android and issue reproduced. Not tested in iOS.

Expected Behavior

When switching between Style1 and Style2, TextDecorations not changed correctly.

<Style x:Key="Style1" Class="Style1" TargetType="Label"> <Setter Property="FontSize" Value="12" /> <Setter Property="HorizontalOptions" Value="FillAndExpand" /> <Setter Property="TextDecorations" Value="None" /> <Setter Property="TextColor" Value="Red" /> </Style>

<Style x:Key="Style2" Class="Style2" TargetType="Label"> <Setter Property="FontSize" Value="16" /> <Setter Property="HorizontalOptions" Value="FillAndExpand" /> <Setter Property="TextDecorations" Value="Underline" /> <Setter Property="TextColor" Value="Green" /> </Style>

Actual Behavior

Basic Information

  • Version with issue:
  • Last known good version:
  • IDE: VS2019
  • Platform Target Frameworks:
    • iOS: Xamarin.Mac SDK 12.4.0.64
    • Android: Latest
    • UWP: 16299
  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices:

Screenshots

Initial Loading
image

After clicking Change Style Buton, Style 1 applied.
image

Again after clicking the change style button, style 2 applied.
image

Again after clicking the change style button, style1 applied. But textdecoration applied from Style 2 is not removed.
image

Reproduction Link

@syncsiva syncsiva added s/unverified New report that has yet to be verified t/bug 🐛 labels Jan 7, 2020
@syncsiva
Copy link
Contributor Author

syncsiva commented Jan 7, 2020

I think the same issue can be reproduced when using DataTrigger also. This issue and the below issue seems related to one another.
#3826

@hartez
Copy link
Contributor

hartez commented Jan 7, 2020

Simpler repro:
_9110 Repro.zip

@hartez hartez added a/style p/Android p/UWP and removed s/unverified New report that has yet to be verified labels Jan 7, 2020
@hartez hartez added the e/4 🕓 4 label Jan 7, 2020
@syncsiva
Copy link
Contributor Author

Please confirm whether fixing the below issue will resolve this issue also?
#4121

@jayaleshwari
Copy link

Can you please update on this ?

@LakshmiNatarajan21
Copy link

Can you please update the timeline for this issue?

@LakshmiNatarajan21
Copy link

Could you please update on this?

@JeyasriVijay
Copy link

Can you please update the timeline for this issue?

@dconlisk
Copy link

I'm seeing a similar issue using sfListView (version 18.1.0.57) with labels on iOS (no problem on Android).

@chrisfoulds
Copy link

Still broke on iOS

@samhouts samhouts added this to the 5.0.0 milestone Aug 13, 2020
@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
@Softtinn
Copy link

This is still a real, and annoying problem. Any workarounds?! The buttons are also affected by this.....

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants