question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MAUI Blazor cannot switch Chinese input language

See original GitHub issue

Description

I am using Visual Studio 2022 Community version for development in a Win11 Chinese environment, with Microsoft Pinyin as my input method. I always keep Microsoft Pinyin open, as it’s my default input method, allowing me to switch between Chinese and English using the SHIFT key. By default, English input is enabled.

I have found that when using internal links in Blazor, there are no issues. However, when I use BlazorWebView to open external links, it causes problems. However, there are no exceptions thrown.

Steps to Reproduce

I have tested two scenarios:

Cannot switch to Chinese input method

  1. Open the BlazorWebView page, with the default input method set to English.
  2. Click on an external link with an address like https://aaa.com/. Use the BlazorWebView.UrlLoading callback to set UrlLoadingEventArgs.UrlLoadingStrategy = UrlLoadingStrategy.OpenInWebView to ensure the page opens in the BlazorWebView. The input method already locked that you can’t switch to Chinese mode.
  3. Perform a series of actions, then return to https://0.0.0.0/... in same BlazorWebView.
  4. At this point, Microsoft Pinyin cannot switch to Chinese input mode using the SHIFT key.

Can switch to Chinese input method

  1. Open the BlazorWebView page, with the default input method set to English. At this point, switch to Chinese input mode.
  2. Click on an external link with an address like https://aaa.com/. Use the BlazorWebView.UrlLoading callback to set UrlLoadingEventArgs.UrlLoadingStrategy = UrlLoadingStrategy.OpenInWebView to ensure the page opens in the BlazorWebView. And Chinese input mode is kept at this moment. Switch between Chinese and English mode is working as expected.
  3. Perform a series of actions, then return to https://0.0.0.0/... in same BlazorWebView.
  4. At this point, Microsoft Pinyin can switch between English and Chinese input mode using the SHIFT key.

Link to public reproduction project repository

https://github.com/Jennal/MAUIBlazorInputBug

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

net7.0-windows10.0.19041.0

Did you find any workaround?

No response

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created 5 months ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Jennalcommented, Apr 15, 2023

Did you try this using WinUI and its built-in WebView?

Not yet, I would try next week.

0reactions
msftbot[bot]commented, Apr 20, 2023

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NET MAUI Blazor Switch Language In-App: Here's How!
You implemented localization on your .NET MAUI app, but are now wondering: how do I switch the language dynamically in app?
Read more >
I can not switch the input language to Chinese after ...
Hi, I can't switch the input language to Chinese event I have installed the language pack. The "Downloading Language Dictionary" message ...
Read more >
MAUI Blazor not respecting device language on iOS
It mixes Swedish (my preferred language) and English. Mixes Swedish and English · Time as well. Has anyone else solved this problem? Repro:https ......
Read more >
Play Audio and Video in .NET MAUI apps with the new ...
NET MAUI has been released; MediaElement. With MediaElement you can easily play audio and video from within your .NET MAUI app, in this...
Read more >
MFC dialog - control display issue on Chinese Language OS.
MFC dialog - control display issue on Chinese Language OS. ... We are unable to investigate this issue further without the additional information...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found