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

FormattedText: Span BackgroundColor does not work #4788

Closed
IndianaGary opened this issue Feb 18, 2022 · 1 comment · Fixed by #5025
Closed

FormattedText: Span BackgroundColor does not work #4788

IndianaGary opened this issue Feb 18, 2022 · 1 comment · Fixed by #5025
Labels
area-controls-label Label, Span fixed-in-6.0.300-rc.1 Look for this fix in 6.0.300-rc.1! good first issue Good for newcomers high It doesn't work at all, crashes or has a big impact. platform/windows 🪟 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@IndianaGary
Copy link

IndianaGary commented Feb 18, 2022

Description

My application supports color syntax highlighting and I expected to be able to use Span to implement it. Unfortunately, setting BackgroundColor does nothing that I could see. Setting TextColor works as expected. I tried setting it directly on a Span, and setting it using a Setter in a Style. Neither one worked. I also expect a Span's BackgroundColor to override any background color set on the containing Label.

Steps to Reproduce

  1. Create a new Maui Project. I named it DebugHelper
  2. Replace MainPage's content with the attached XAML file (zipped); modify the project name it to match yours.
  3. Observe that Span BackgroundColor is inoperative.

Note the following: The encompassing Label is Magenta text on a Green background because of the default Style. The Span's default Style should override this to be Navy text on an Orange background, except for the first Span, which explicitly sets it to be Yellow text on a Red background:

  1. Navy text works but Orange background does not.
  2. Yellow text works but Red background does not.

The attached zip file contains MainPage.xaml and MainPage.xaml.cs.

SpanProblem.zip

Version with bug

Preview 13 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows, I was not able test on other platforms

Affected platform versions

Windows SDK 10.0.18362 and later

Did you find any workaround?

No workaround was apparent.

Relevant log output

None

@IndianaGary IndianaGary added the t/bug Something isn't working label Feb 18, 2022
@jsuarezruiz jsuarezruiz added area-controls-label Label, Span high It doesn't work at all, crashes or has a big impact. labels Feb 21, 2022
@Eilon Eilon added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Feb 22, 2022
@PineYi
Copy link

PineYi commented Feb 24, 2022

Verified Repro with Windows. Repro Project is available:
#4788.zip

@kristinx0211 kristinx0211 added the s/verified Verified / Reproducible Issue ready for Engineering Triage label Feb 24, 2022
@Redth Redth added the good first issue Good for newcomers label Feb 24, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Apr 2, 2022
@samhouts samhouts added the fixed-in-6.0.300-rc.1 Look for this fix in 6.0.300-rc.1! label Feb 17, 2023
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-label Label, Span fixed-in-6.0.300-rc.1 Look for this fix in 6.0.300-rc.1! good first issue Good for newcomers high It doesn't work at all, crashes or has a big impact. platform/windows 🪟 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants