Open Soap-141 opened 11 months ago
@jeromelaban it might be related to https://github.com/unoplatform/uno/issues/13351
As a workaround you can schedule the change asynchronously on the dispatcher, that should work
@MartinZikmund I will try thanks!
@MartinZikmund Not working in the dispatcher.
@Soap-141 I noticed that we are using AdjustNothing
at this line
Can you try using AdjustResize
and see what happens?
@kazo0 It will semi fix Android because it will only push up to the text and not the textbox, I assume that Uno want to manage that on it's on so no conflict? Also this part won't fix it for iOS.
I tested this with one of the latest stable Uno Platform (5.0.41), and I could not reproduce it anymore.
@Soap-141 can you give it a try
Btw, this is the repo with my changes: https://github.com/ajpinedam/ChatAppUI
Note: The issue seems to be related to the focus. Notice that the problem only occurs when you dismiss the keyboard using the navigation buttons, and the TextBox keeps the focus. On the other hand, when the Keyboard is dismissed by tapping outside, the error does not happen.
Video showing the sample I ran with Uno 5.0.41:
https://github.com/unoplatform/uno/assets/1900897/da3baa4a-5938-43b5-a0e7-d9ee65db2f87
Current behavior
We noticed an issue with the keyboard in our chat application on Android and sometimes iOS that I can't reproduce unfortunately. Basically at first we were using the
Uno.Toolkit.UI
SafeArea
control (it had the same issue) but since we were using it in a page containing aListView
we knew it was a bad idea since the control basically wraps its content in aScrollViewer
. So we made a draft for a custom behavior to add margin when the keyboard is hiding our container and we noticed that on mobile, when we have more then like two item in our list, the layout is not built correctly most of the time it only works the first time and then it does not.The issue in the sample I made is very similar to our chat application but slightly different because in this one, the
TextBox
goes up but not chat while in our real application it is a mix of both.This is an issue using
Uno.Extensions
andChinook
frameworks (Feeds
&DataLoader
).Also, the keyboard behavior is not supported out of the box in the Uno chat sample.
Expected behavior
It should behave like iOS when it's working. We did encounter the issue on iOS but I'm not able to reproduce it.
How to reproduce it (as minimally and precisely as possible)
TextBox
.Workaround
Nothing that I know off. I tried to rebuild the layout of the
Grid
usingInvalidateMeasure
and all that stuff but it did not work.Works on UWP/WinUI
None
Environment
Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia, Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia
NuGet package version(s)
Latest Uno 5 preview and Latest Uno 4.10 stable release.
Affected platforms
Android, iOS
IDE
Visual Studio 2022
IDE version
17.7.5
Relevant plugins
N/A
Anything else we need to know?
Keyboard management sample code is in
InputPaneExtensions.PanIntoView.cs
.