 
     func textViewDidBeginEditing(_ textView: UITextView) {
         _delegate?.textViewDidBeginEditing?(textView)
+        setClearButtonHidden(textView.text.isEmpty)
     }
 
     func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool {
-        clearButton.isHidden = text.isEmpty
         return _delegate?.textView?(textView, shouldChangeTextIn: range, replacementText: text) ?? true
     }
 


    func textViewDidEndEditing(_ textView: UITextView) {
        _delegate?.textViewDidEndEditing?(textView)
        clearButton.isHidden = true
    }

    func textViewShouldEndEditing(_ textView: UITextView) -> Bool {

    @objc private func clear() {
        text = nil
    }

    private func setClearButtonHidden(_ hidden: Bool) {
        guard clearButton.isHidden != hidden else {
            return
        }
        clearButton.isHidden = hidden
    }
}

extension ThemeableTextView: UITextViewDelegate {
    func textViewDidChange(_ textView: UITextView) {
        _delegate?.textViewDidChange?(textView)
        setClearButtonHidden(textView.text.isEmpty)
    }

    func textViewShouldBeginEditing(_ textView: UITextView) -> Bool {
