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

[WASM] TextBox text selection behaves differently between WinUI and WASM #16780

Closed
darenm opened this issue May 19, 2024 · 5 comments · Fixed by #16982
Closed

[WASM] TextBox text selection behaves differently between WinUI and WASM #16780

darenm opened this issue May 19, 2024 · 5 comments · Fixed by #16982
Assignees
Labels
difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform project/text 🔤 Categorizes an issue or PR as relevant to text (TextBox, PasswordBox, TextBlock, Fonts, …)

Comments

@darenm
Copy link
Contributor

darenm commented May 19, 2024

Current behavior

In the circumstance where the text content of a TextBox is longer than can be displayed in a width constrained TextBox, using the mouse to select the text causes the text content to scroll on Desktop. This does not occur as expected in WASM. This occurs with a simple TextBox and a TextBox surrounded by a ScrollViewer. We are seeing this problem in a DataGrid, but this repro is simpler.

Desktop:
TextBoxContentScrolling

Web:
TextBoxContentScrolling-web

Expected behavior

The WASM version behaves the same as the WinUI version.

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

Here's a playground link:

http://playground.platform.uno/#5ed47dfa

Here's the repro:

UnoDatagridTextboxDragToSelect.zip

Workaround

No response

Works on UWP/WinUI

Yes

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

No response

Affected platforms

WebAssembly

IDE

Visual Studio 2022

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

@darenm darenm added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels May 19, 2024
@darenm darenm changed the title [WASM} TextBox text selection behaves differently between WinUI and WASM [WASM] TextBox text selection behaves differently between WinUI and WASM May 19, 2024
@Youssef1313 Youssef1313 added platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform project/text 🔤 Categorizes an issue or PR as relevant to text (TextBox, PasswordBox, TextBlock, Fonts, …) project/input ⌨️ Categorizes an issue or PR as relevant to input (Button, CheckBox, Toggle, Scroll, Map, Numeric,...) and removed project/input ⌨️ Categorizes an issue or PR as relevant to input (Button, CheckBox, Toggle, Scroll, Map, Numeric,...) labels May 19, 2024
@MartinZikmund MartinZikmund added difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI and removed difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. triage/untriaged Indicates an issue requires triaging or verification labels May 29, 2024
@MartinZikmund
Copy link
Member

MartinZikmund commented May 31, 2024

@darenm As @Youssef1313 investigated this, it seems that this behavior is currently not possible to influence from our side, as it is the built-in scrolling behavior of the browser. A workaround could be to keep the text entries wide enough so that the scrolling is not necessary, but apart from it seems very tricky to adjust.

@Youssef1313
Copy link
Member

To clarify, the normal native behavior is actually that the text should scroll correctly. However, somehow this is not happening in our case. My first thought was that we are preventing the default behavior somewhere, so I went ahead and commented out all preventDefault usages in our code to see if it makes a difference, but still, we didn't get the desired native behavior.

It's likely something to fix on our side, but it's unclear to me why we are not getting the expected native behavior.

@MartinZikmund MartinZikmund linked a pull request Jun 3, 2024 that will close this issue
6 tasks
@MartinZikmund
Copy link
Member

@darenm found the reason behind this, PR in progress

@darenm
Copy link
Contributor Author

darenm commented Jun 3, 2024

@MartinZikmund That's excellent news.

@darenm
Copy link
Contributor Author

darenm commented Jun 27, 2024

@jeromelaban can we back port this to 5.2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform project/text 🔤 Categorizes an issue or PR as relevant to text (TextBox, PasswordBox, TextBlock, Fonts, …)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants