     }
 
     // MARK: - Private methods
+
+    private func updateBoundsToFitSize() {
+        guard #available(iOS 13.0, *) else { return }
+
+        /*
+         Since iOS 13 Beta 4, changing a text doesn't cause a recalculation of the content size.
+         Because of this, invalidateIntrinsicContentSize is not called, and layout is not updated.
+         To fix it, updateBoundsToFitSize should be called on each text change.
+
+         Analyzing a stack trace:
+         -[_UITextContainerView setConstrainedFrameSize:] is still called.
+         -[_UITextContainerView setFrame:] is NOT called since iOS 13 Beta 4.
+         */
+
+        self.bounds.size = self.sizeThatFits(self.bounds.size)
+    }
 
     private func scrollToCaret() {
         if let textRange = self.selectedTextRange {

    }

    @objc func textDidChange() {
        self.updatePlaceholderVisibility()
        self.scrollToCaret()



    private func commonInit() {
        NotificationCenter.default.addObserver(self, selector: #selector(ExpandableTextView.textDidChange), name: UITextView.textDidChangeNotification, object: self)
        self.updateBoundsToFitSize()
        self.configurePlaceholder()
        self.updatePlaceholderVisibility()
    }
