         }
         set {
             self.placeholder.text = newValue
-            self.doAnAdditionalCallOf_updateBoundsToFitSize_forIOS13()
+            self.invalidateIntrinsicContentSize()
         }
     }
 


    // MARK: - Private methods

    private func updateBoundsToFitSize() {
        self.bounds.size = self.sizeThatFits(self.bounds.size)
    }
    
    private func doAnAdditionalCallOf_updateBoundsToFitSize_forIOS13() {
        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.updateBoundsToFitSize()
    }

    private func scrollToCaret() {
        if let textRange = self.selectedTextRange {
            var rect = caretRect(for: textRange.end)


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

        // Bugfix:
