From 51628034d96c9b9d7e6ed730c2f7670fbf6accbe Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 29 Oct 2024 16:42:16 -0700
Subject: [PATCH] Don't offset the view if there's no text input rect
Otherwise this will shift the entire view upwards, which probably isn't what you want.
---
src/video/uikit/SDL_uikitviewcontroller.m | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/video/uikit/SDL_uikitviewcontroller.m b/src/video/uikit/SDL_uikitviewcontroller.m
index 15efd37354b59..57f4888d0d01c 100644
--- a/src/video/uikit/SDL_uikitviewcontroller.m
+++ b/src/video/uikit/SDL_uikitviewcontroller.m
@@ -609,7 +609,7 @@ - (void)updateKeyboard
CGRect frame = UIKit_ComputeViewFrame(window, data.uiwindow.screen);
#endif
- if (self.keyboardHeight) {
+ if (self.keyboardHeight && self.textInputRect.h) {
int rectbottom = (int)(self.textInputRect.y + self.textInputRect.h);
int keybottom = (int)(self.view.bounds.size.height - self.keyboardHeight);
if (keybottom < rectbottom) {