         return !(unmodifiedWikiText == textView.text)
     }
 
-    override var canBecomeFirstResponder: Bool {
-        return true
-    }
-
-    private var isCustomInputViewHidden: Bool = true
+    private var isCustomInputViewHidden: Bool = true {
+        didSet {
+            if isCustomInputViewHidden {
+                preferredAccessoryView = previousPreferredAccessoryView
+            } else {
+                preferredAccessoryView = nil
+            }
+        }
+    }
 
     func setCustomInputViewHidden(type: TextFormattingInputViewController.InputViewType? = nil, hidden: Bool) {
-        let responder = isFirstResponder ? self : textView
-
-        setCursorPositionIfNeeded()
+        isCustomInputViewHidden = hidden
 
         let animator = UIViewPropertyAnimator.init(duration: 0.3, curve: .easeInOut) {
-            responder?.resignFirstResponder()
+            self.textView.resignFirstResponder()
         }
 
         animator.addCompletion { (_) in


    private func configureAccessoryViews() {
        defaultEditToolbar.delegate = self
    }

    private func setCursorPositionIfNeeded() {
        let shouldSetCursor = !textView.isFirstResponder

        guard shouldSetCursor else {
            return
        }

        let newPosition = textView.beginningOfDocument
        textView.selectedTextRange = textView.textRange(from: newPosition, to: newPosition)
    }

    private func loadWikitext() {


        animator.startAnimation()

        preferredInputViewType = type
    }

    override func viewDidLoad() {
