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

fix: Ensure Fluent resources for AutoSuggestBox on WASM #1173

Merged
merged 4 commits into from
Oct 16, 2024

Conversation

mcNets
Copy link
Contributor

@mcNets mcNets commented Oct 8, 2024

GitHub Issue (If applicable): closes #

unoplatform/uno#15967

PR Type

What kind of change does this PR introduce?

Forces Fluent style on AutosuggestBox popup in Wasm.

  • Bugfix

What is the current behavior?

Autosuggest box has Material styles applied.

What is the new behavior?

When the page loads gets the Border's popup control via GetTemplateChild and applies EnsureXamlControlsResources() method.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested on iOS.
  • Tested on Wasm.
  • Tested on Android.
  • Tested on UWP.
  • Tested in both Light and Dark themes.
  • Associated with an issue (GitHub or internal)

Other information

I got the name of the Border from the microsoft repo.

https://github.com/microsoft/microsoft-ui-xaml/blob/d74a0332cf0d5e58f12eddce1070fa7a79b4c2db/src/controls/dev/AutoSuggestBox/AutoSuggestBoxHelper.cpp#L8-L13

Internal Issue (If applicable):
unoplatform/uno#15967

@morning4coffe-dev
Copy link
Member

Thanks! I have tested this fix with multiple different platforms, and it all seems to work well now. It doesn't seem to crash on Windows on my side + this fix is not only for wasm, but for all platforms. We should also apply this fix for the main search as well:
image

@mcNets
Copy link
Contributor Author

mcNets commented Oct 9, 2024

@morning4coffe-dev have a look, now it is applying Fluent to all AutosuggestBox

@morning4coffe-dev
Copy link
Member

Thank you, @mcNets! Looks good. Could you check an error error CS7036: There is no argument given that corresponds to the required parameter 'childName' of 'ControlHelper.GetTemplateChild<TControl>(Control, Func<string, DependencyObject>, string)' on Windows after your last commit? There could be some clash between MUXC and Uno.Themes

GetTemplateChild on Windows uses Uno.Themes / GetTemplateChild extension class instead of Microsoft.UI.Xaml.Controls.
@mcNets
Copy link
Contributor Author

mcNets commented Oct 13, 2024

@morning4coffe-dev windows head works fine without ensuring xaml resources so I used a conditional. I don't know why Windows head is using the extension class in Uno.Themes instead of Control.GetTemplateChild in Microsoft.UI.Xaml.Controls.

https://github.com/unoplatform/Uno.Themes/blob/master/src/library/Uno.Themes/Helpers/ControlHelper.cs

@morning4coffe-dev
Copy link
Member

No problem, I can confirm, this works well now. Only problem, I am seeing is the search popup is too wide, but that is a different issue:
image

Co-authored-by: Dominik Titl <78549750+morning4coffe-dev@users.noreply.github.com>
@MartinZikmund MartinZikmund merged commit f147f56 into unoplatform:master Oct 16, 2024
15 checks passed
Copy link

welcome bot commented Oct 16, 2024

Congrats on your first pull-request! We ❤ the people who are involved in this project, and we’d love to pay it forward by sending you some swag. If you have any feedback (or ideas how to improve Uno as a open-source project) please open a feedback issue.
giphy
Merci beaucoup 👋

@mcNets mcNets deleted the fluent-autosuggestbox branch October 17, 2024 06:46
@morning4coffe-dev
Copy link
Member

Thank you @mcNets again for helping on this and for your contribution!

@mcNets
Copy link
Contributor Author

mcNets commented Oct 17, 2024

@morning4coffe-dev thank you for your help.

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

Successfully merging this pull request may close these issues.

4 participants