Skip to content

Commit

Permalink
Fix keyboardObserving
Browse files Browse the repository at this point in the history
  • Loading branch information
ruixhuang committed Jan 15, 2025
1 parent 1415c3d commit dd1871b
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -69,7 +74,6 @@ public class dydxSimpleUIMarketsViewModel: PlatformViewModel {
self.marketList?.createView(parentStyle: style)
}
}
.keyboardObserving()
}
.clipped() // prevent blending into status bar

Expand All @@ -89,6 +93,7 @@ public class dydxSimpleUIMarketsViewModel: PlatformViewModel {
.frame(maxWidth: .infinity)
.background(gradient)
}
.keyboardObserving()
}
.frame(maxWidth: .infinity)
.themeColor(background: .layer2)
Expand Down

0 comments on commit dd1871b

Please sign in to comment.