         if textField.isFirstResponder {
             textField.resignFirstResponder()
             self.removeFromSuperview()
+            tapView.removeFromSuperview()
         } else {
+            appWindow.addSubview(tapView)
             appWindow.addSubview(self)
             textField.becomeFirstResponder()
         }

        didSet {
            textField.frame = CGRect.init(x: 0, y: 0, width: defaultFrame.size.width, height: textFieldHeight)
            toolbar.frame = CGRect.init(x: 0, y: textFieldHeight, width: defaultFrame.size.width, height: toolbarHeight)
        }
    }
    
    private let doneBarButton = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(KMKeys.done))
    private let cancelBarButton = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(KMKeys.cancel))
    private let flexibleSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)

    
    private func setup() {
        self.toolbar.items = [cancelBarButton, flexibleSpace, doneBarButton]
        self.tapView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(cancel)))
        
        self.frame = defaultFrame
        self.addSubview(textField)
