   }
 
   open override func textDidChange(_ textInput: UITextInput?) {
+    // Swallows self-triggered calls from emptying the context due to keyboard rules
+    if self.swallowBackspaceTextChange {
+      self.swallowBackspaceTextChange = false
+      return
+    }
+    
     let contextBeforeInput = textDocumentProxy.documentContextBeforeInput ?? ""
     let contextAfterInput = textDocumentProxy.documentContextAfterInput ?? ""
     let context = "\(contextBeforeInput)\(contextAfterInput)"

    }

    setContextState(text: context, range: NSRange(newRange, in: context))
  }

  func insertText(_ keymanWeb: KeymanWebViewController, numCharsToDelete: Int, newText: String) {

        }
      }
    }
    
    self.swallowBackspaceTextChange = true
    // afterDelay 0.01 is not sufficient!  0.02 seems to be enough for an actual delay to register.
    perform(#selector(self.clearSwallowFlag), with: nil, afterDelay: 0.02)

    if !newText.isEmpty {
      textDocumentProxy.insertText(newText)
