From dd1871bdc3cdfc00445926099e5620559f9adac1 Mon Sep 17 00:00:00 2001 From: Rui Date: Wed, 15 Jan 2025 12:39:29 -0800 Subject: [PATCH] Fix keyboardObserving --- .../_v4/SimpleUI/Markets/dydxSimpleUIMarketsView.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dydx/dydxViews/dydxViews/_v4/SimpleUI/Markets/dydxSimpleUIMarketsView.swift b/dydx/dydxViews/dydxViews/_v4/SimpleUI/Markets/dydxSimpleUIMarketsView.swift index c96c86e1..7646c90a 100644 --- a/dydx/dydxViews/dydxViews/_v4/SimpleUI/Markets/dydxSimpleUIMarketsView.swift +++ b/dydx/dydxViews/dydxViews/_v4/SimpleUI/Markets/dydxSimpleUIMarketsView.swift @@ -35,7 +35,12 @@ public class dydxSimpleUIMarketsViewModel: PlatformViewModel { PlatformView(viewModel: self, parentStyle: parentStyle, styleKey: styleKey) { [weak self] style in guard let self = self else { return AnyView(PlatformView.nilView) } - let bottomPadding = max((self.safeAreaInsets?.bottom ?? 0), 16) + let bottomPadding: CGFloat + if keyboardUp { + bottomPadding = 16 + } else { + bottomPadding = max((self.safeAreaInsets?.bottom ?? 0), 16) + } let view = VStack(spacing: 8) { ZStack(alignment: .bottom) { @@ -69,7 +74,6 @@ public class dydxSimpleUIMarketsViewModel: PlatformViewModel { self.marketList?.createView(parentStyle: style) } } - .keyboardObserving() } .clipped() // prevent blending into status bar @@ -89,6 +93,7 @@ public class dydxSimpleUIMarketsViewModel: PlatformViewModel { .frame(maxWidth: .infinity) .background(gradient) } + .keyboardObserving() } .frame(maxWidth: .infinity) .themeColor(background: .layer2)