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

[Gallery][WASM]AutoSuggestBox- In the 'Autosuggest Box with Search Box experience' section, the descriptions of the controls are not displaying on multiple lines. #15967

Open
sakshi173 opened this issue Mar 20, 2024 · 22 comments · Fixed by unoplatform/Uno.Gallery#1173
Labels
area/canary 🐤 Categorizes an issue or PR as relevant to canary testing difficulty/starter 🚀 Categorizes an issue for which the difficulty level is reachable by newcomers good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/bug Something isn't working platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform project/styling 👔 Categorizes an issue or PR as relevant to element styling project/themes-toolkit-gallery Categorizes an issue or PR as relevant to Uno.Themes\Toolkit\Gallery

Comments

@sakshi173
Copy link

Current behavior

Auto suggest text not properly display issue
Auto suggest text not properly display issue 2

Expected behavior

Auto suggest text Correct

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

  1. Open Uno Gallery APP
  2. Tap Burger Menu on the left top right.
  3. Tap "AutoSuggestBox" from the "UI Component" list.
  4. Type any component related letters like 'B' for 'Autosuggest Box with Search Box experience' section.
  5. Notice that that the control's descriptions are displaying in a single line, causing the text to become less visible when the screen is resized smaller.

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

WebAssembly

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

@sakshi173 sakshi173 added kind/bug Something isn't working platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform triage/untriaged Indicates an issue requires triaging or verification area/canary 🐤 Categorizes an issue or PR as relevant to canary testing difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Mar 20, 2024
@jeromelaban
Copy link
Member

@kazo0 could it be a material style issue?

@kazo0
Copy link
Contributor

kazo0 commented Mar 22, 2024

@jeromelaban
There's no Material style for AutoSuggestBox, might be using the Material FlyoutPresenterStyle by accident though.

@MartinZikmund MartinZikmund added project/styling 👔 Categorizes an issue or PR as relevant to element styling difficulty/starter 🚀 Categorizes an issue for which the difficulty level is reachable by newcomers project/themes-toolkit-gallery Categorizes an issue or PR as relevant to Uno.Themes\Toolkit\Gallery good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. 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 Jul 16, 2024
@mcNets
Copy link
Contributor

mcNets commented Oct 3, 2024

@jeromelaban @kazo0 AutosuggestBox shows more than one line. If you keep scrolling, you may get an item with 2 lines. Maybe the visual appearance can be improved by adding margin on the right and left.

Problem, when you resize the browser window, AutosuggestBox size doesn't change and some parts become hidden.

May I send a PR to this repo?

image

image

@agneszitte
Copy link
Contributor

agneszitte commented Oct 3, 2024

@jeromelaban There's no Material style for AutoSuggestBox, might be using the Material FlyoutPresenterStyle by accident though.

@kazo0 I think you are maybe right here, as I am noticing some purple for the hover state here
image

Compared to Fluent theme:
image

@agneszitte
Copy link
Contributor

agneszitte commented Oct 3, 2024

@jeromelaban There's no Material style for AutoSuggestBox, might be using the Material FlyoutPresenterStyle by accident though.

@kazo0 I think you are maybe right here, as I am noticing some purple for the hover state here

So @mcNets I think we are maybe just missing

                        <StackPanel.Resources>
                            <ResourceDictionary>
                                <ResourceDictionary.MergedDictionaries>
                                    <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
                                </ResourceDictionary.MergedDictionaries>
                            </ResourceDictionary>
                        </StackPanel.Resources>

(similar to https://github.com/unoplatform/Uno.Gallery/blob/57fdfbda48b7eeab81fa054e3a71d6f2eb551d2a/Uno.Gallery/Views/SamplePages/ContentDialogSamplePage.xaml#L95)

at this level for the AutoSuggestBoxSamplePage
https://github.com/unoplatform/Uno.Gallery/blob/57fdfbda48b7eeab81fa054e3a71d6f2eb551d2a/Uno.Gallery/Views/SamplePages/AutoSuggestBoxSamplePage.xaml#L15

@mcNets
Copy link
Contributor

mcNets commented Oct 3, 2024

@agneszitte I've added the code you posted, but I'm not sure this is the issue. Initially flyout has a Width=300, but when you make the browser window narrow, it automatically changes to a larger size, and then do not recover the original size, and the flyout content remains hidden.

Desktop project behaves the same way.

When NavigationView is in compact mode, the FlyOut is then resized again and wrap the content.

flyout.mp4

@agneszitte
Copy link
Contributor

agneszitte commented Oct 3, 2024

@agneszitte I've added the code you posted, but I'm not sure this is the issue. Initially flyout has a Width=300, but when you make the browser window narrow, it automatically changes to a larger size, and then do not recover the original size, and the flyout content remains hidden.

Thanks for giving it a try @mcNets. Maybe I am mistaken but I think it is still taking the Material theme here visually and for that reason not using the fluent theme properly (which hopefully could normally resolve the main issue here in terms of padding, wrapping, etc...)

@agneszitte
Copy link
Contributor

agneszitte commented Oct 4, 2024

Thanks for giving it a try @mcNets. Maybe I am mistaken but I think it is still taking the Material theme here visually and for that reason not using the fluent theme properly (which hopefully could normally resolve the main issue here in terms of padding, wrapping, etc...)

Related issue: unoplatform/Uno.Gallery#1069 (comment)
And I think as @Xiaoy312 mentioned, the problem may be of the same nature as: unoplatform/Uno.Gallery#1093

@mcNets
Copy link
Contributor

mcNets commented Oct 5, 2024

@agneszitte I tried to apply the same approach as @morning4coffe-dev did on unoplatform/Uno.Gallery#1123, but it still seems a bit purple.

		public AutoSuggestBoxSamplePage()
		{
			this.InitializeComponent();
			Loaded += AutoSuggestBoxSamplePage_Loaded;
		}

		private void AutoSuggestBoxSamplePage_Loaded(object sender, RoutedEventArgs e)
		{
			var boxes = VisualTreeHelperEx.GetDescendants(this)
				.OfType<AutoSuggestBox>()
				.ToList();

			foreach (var box in boxes)
			{
				box.EnsureXamlControlsResources();
			}

			Loaded -= AutoSuggestBoxSamplePage_Loaded;
		}

image

@morning4coffe-dev
Copy link
Member

I have an ongoing PR for fixing this issue unoplatform/Uno.Gallery#1134, but I haven't been able to prioritize. Thank you for looking into this @mcNets. On the image you shared, it is purple as the individual items are still material. We can discuss further, if you want to continue with this issue.

@mcNets
Copy link
Contributor

mcNets commented Oct 7, 2024

No thank you @morning4coffe-dev , go ahead. I'll take another one. Are you changing the style everytime a new popup appears?

@morning4coffe-dev
Copy link
Member

As far as I remember, the solution I worked on only functioned after opening the popup for the second time, which is why it hasn't been merged yet. If you'd like, you can take a look at my PR and maybe pick it up if you get any ideas from it.

@mcNets
Copy link
Contributor

mcNets commented Oct 7, 2024

@morning4coffe-dev If I am not wrong TextChanged event if fired before the suggestion list is open.

if (sender.IsSuggestionListOpen)
{
	var popup = VisualTreeHelper.GetOpenPopupsForXamlRoot(XamlRoot).FirstOrDefault();
	popup.EnsureXamlControlsResources(true);
	(popup.Child as Border).EnsureXamlControlsResources(true);
}

So until TextChanged event is fired again, for example when you add another character or select one option or you clear the TextBox, the style is no applied. Try by press 'b' and when the popup is visible, click 'o', it will change to Fluent.

Set a breakpoint inside the if condition and you'll see it.

@mcNets
Copy link
Contributor

mcNets commented Oct 8, 2024

@morning4coffe-dev would you mind if I make a modification in your code?

@morning4coffe-dev
Copy link
Member

@mcNets Not at all, I am happy to collab with you this way! Thank you 😇

@mcNets
Copy link
Contributor

mcNets commented Oct 8, 2024

@morning4coffe-dev Your PR was created with the previous multi-project version, and I'm not sure to be able to send a PR to your PR, do you mind if I generate a new PR?

Besides, UWP project where the changes are applied, is not loading.

@morning4coffe-dev
Copy link
Member

@mcNets For sure, no problem, you can create a new PR and we can close off mine, after merging. Hmm... interesting, I am happy to take a look, after you make the PR on why it might not be loading.

@mcNets
Copy link
Contributor

mcNets commented Oct 8, 2024

@morning4coffe-dev I don't know if mine will load....

unoplatform/Uno.Gallery#1173

@morning4coffe-dev
Copy link
Member

This issue should be fixed now via unoplatform/Uno.Gallery#1173.

@agneszitte
Copy link
Contributor

Thank you so much again, @mcNets, for your valuable contribution to this issue! It's greatly appreciated ❣️

@agneszitte
Copy link
Contributor

@jhanvi03 I will let you do some final tests please

@jhanvi03
Copy link

The issue Still persist with Versions:

Package Referenced version Updated version
Uno.CommunityToolkit.WinUI.UI.Controls 7.1.200 7.1.203
Uno.CommunityToolkit.WinUI.UI.Controls.DataGrid 7.1.200 7.1.203
Uno.Core.Extensions.Compatibility 4.0.1 4.1.1
Uno.Core.Extensions.Disposables 4.0.1 4.1.1
Uno.Sdk 5.3.96 5.6.0-dev.32

Package Referenced version Updated version
Uno.CommunityToolkit.WinUI.UI.Controls 7.1.200 7.1.203
Uno.CommunityToolkit.WinUI.UI.Controls.DataGrid 7.1.200 7.1.203
Uno.Core.Extensions.Compatibility 4.0.1 4.1.1
Uno.Core.Extensions.Disposables 4.0.1 4.1.1
Uno.Sdk 5.3.96 5.6.0-dev.32

image

@jhanvi03 jhanvi03 reopened this Oct 23, 2024
@jhanvi03 jhanvi03 removed their assignment Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/canary 🐤 Categorizes an issue or PR as relevant to canary testing difficulty/starter 🚀 Categorizes an issue for which the difficulty level is reachable by newcomers good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/bug Something isn't working platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform project/styling 👔 Categorizes an issue or PR as relevant to element styling project/themes-toolkit-gallery Categorizes an issue or PR as relevant to Uno.Themes\Toolkit\Gallery
Projects
None yet
8 participants