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

Linebreak in Label,Text XAML not displayed in App #21605

Closed
Kaibaer opened this issue Apr 2, 2024 · 5 comments
Closed

Linebreak in Label,Text XAML not displayed in App #21605

Kaibaer opened this issue Apr 2, 2024 · 5 comments
Labels
area-controls-label Label, Span area-xaml XAML, CSS, Triggers, Behaviors platform/android 🤖 platform/windows 🪟 s/move-to-vs-feedback Tells automation to ask the person to use VS Feedback to report the issue s/triaged Issue has been reviewed t/bug Something isn't working
Milestone

Comments

@Kaibaer
Copy link

Kaibaer commented Apr 2, 2024

Description

In order to put in content on an About page, I want to use line breaks. However, when using an <Label.Text>, the line breaks do not show up as actually shown in the documentation (https://learn.microsoft.com/de-de/dotnet/maui/user-interface/controls/label?view=net-maui-8.0)
The text is concatenated in the same line until the space for the line is filled out.

Steps to Reproduce

  1. Create a page
  2. Add <Label.Text> and add lines of text.
    AboutLineBreak

Link to public reproduction project repository

https://github.com/Kaibaer/CinemaRaffler

Version with bug

8.0.7 SR2

Is this a regression from previous behavior?

No, this is something new, Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android, Windows

Affected platform versions

Android 14, Windows 11

Did you find any workaround?

No response

Relevant log output

No response

@ninachen03
Copy link

Verified this issue with Visual Studio 17.10.0 Preview 2 (8.0.7) on windows platform. can not repro it.
image

@ninachen03 ninachen03 added s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version labels Apr 3, 2024
@jfversluis
Copy link
Member

Hey @Kaibaer!

I checked out your about page branch and seems to work all fine here on Android. You specified this also happens on Android, right?

image

Didn't check Windows, but all other platforms seem to work so I kinda expect it to work on Windows as well.

The one thing I needed to change is that you both specify the FormattedText and the regular Text property. One will override the other. The weird indentation in because the Text value is indented because of the source code indentation. Otherwise, the line breaks seem to work fine.

If you still see this behavior, can you provide some more clarity and details on where you're seeing it exactly?

@jfversluis jfversluis added s/needs-info Issue needs more info from the author and removed s/try-latest-version Please try to reproduce the potential issue on the latest public version labels Apr 3, 2024
@Kaibaer
Copy link
Author

Kaibaer commented Apr 3, 2024

I found out it actually happens as soon as you edit the XAML page while having the emulator open to have a visual indication.
If you add another line there, it stays in the same line as the last line.

So, upon start it looks okay and takes the linebreak.

However, as your screenshot @jfversluis and @ninachen03 show, the text indentation is a topic. Is there a way to deactivate the identation? It also seems to ignore indentation for the first sentence, which also has the same indents as the other lines.

@dotnet-policy-service dotnet-policy-service bot added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Apr 3, 2024
@mattleibow mattleibow added this to the Backlog milestone Apr 3, 2024
@mattleibow mattleibow removed the s/needs-attention Issue has more information and needs another look label Apr 3, 2024
@jfversluis
Copy link
Member

However, as your screenshot @jfversluis and @ninachen03 show, the text indentation is a topic.

Unfortunately it's not a topic. The space is there in the text so it's shown that way, if you don't want to do it like that use the new line characters for XAML or bind your text through a view model or provide it through resources. There is not much we can change about that.

OK so what you are describing is Hot Reload, unfortunately that is on the tooling side and should be reported in a different way. I will close this one and add a tag that will provide you with the necessary information on how to do that.

cc: @drasticactions

@jfversluis jfversluis added the s/move-to-vs-feedback Tells automation to ask the person to use VS Feedback to report the issue label Apr 4, 2024
Copy link
Contributor

Thanks for the issue report @Kaibaer! This issue appears to be a problem with Visual Studio, so we ask that you use the VS feedback tool to report the issue. That way it will get to the routed to the team that owns this experience in VS.

If you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks.

  1. Go to the Visual Studio for Windows feedback tool or Visual Studio for Mac feedback tool to report the issue
  2. Close this bug, and consider adding a link to the VS Feedback issue so that others can follow its activity there.

@jfversluis jfversluis closed this as not planned Won't fix, can't repro, duplicate, stale Apr 4, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 5, 2024
@samhouts samhouts added area-xaml XAML, CSS, Triggers, Behaviors area-controls-label Label, Span labels Aug 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-label Label, Span area-xaml XAML, CSS, Triggers, Behaviors platform/android 🤖 platform/windows 🪟 s/move-to-vs-feedback Tells automation to ask the person to use VS Feedback to report the issue s/triaged Issue has been reviewed t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants