Skip to content

Commit e569a04

Browse files
committed
fix(net6): Adjust keyboard location computation
1 parent 52a04f6 commit e569a04

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Uno.UI/Controls/Window.iOS.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,12 @@ public override UIView HitTest(CGPoint point, UIEvent uievent)
195195

196196
private void OnKeyboardWillShow(object sender, UIKeyboardEventArgs e)
197197
{
198-
#if !MACCATALYST && !IOS // Fix on .NET 6 Preview 6 https://github.com/unoplatform/uno/issues/5873
198+
#if NET6_0_OR_GREATER
199+
_inputPane.OccludedRect = ((NSValue)e.Notification.UserInfo.ObjectForKey(UIKeyboard.FrameEndUserInfoKey)).CGRectValue;
200+
#else
199201
var keyboardRect = ((NSValue)e.Notification.UserInfo.ObjectForKey(UIKeyboard.BoundsUserInfoKey)).RectangleFValue;
200202
var windowRect = Windows.UI.Xaml.Window.Current.Bounds;
201203
_inputPane.OccludedRect = new Rect(0, windowRect.Height - keyboardRect.Height, keyboardRect.Width, keyboardRect.Height);
202-
#else
203-
this.Log().Warn("OnKeyboardWillShow is disabled restore on .NET 6 Preview 6: https://github.com/unoplatform/uno/issues/5873");
204204
#endif
205205
}
206206

0 commit comments

Comments
 (0)