   }
   
   func resetContext() {
-    keymanWeb.resetContext()
+    if self.swallowContextChangeCount <= 0 {
+      keymanWeb.resetContext()
+    }
   }
 
   internal func setSentryState(enabled: Bool) {

    // Refer to https://github.com/keymanapp/keyman/pull/2770 for context.
    if self.swallowBackspaceTextChange && Manager.shared.isSystemKeyboard && textDocumentProxy.documentContextBeforeInput == "\n" {
      self.swallowBackspaceTextChange = false
      return
    }
    

  private var keymanWeb: KeymanWebViewController
  
  private var swallowBackspaceTextChange: Bool = false
  private var swallowContextChangeCount: Int = 0

  open class var isPortrait: Bool {
    return UIScreen.main.bounds.width < UIScreen.main.bounds.height
