You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using RichTextViewController with a UIViewRepresentable in SwiftUI, it would be helpful to be able to control whether the textView content is scrollable in the view controller.
The issue that occurs is that if you ever want to include the RichTextViewController amongst other SwiftUI content, the scroll behavior is always determined by the hardcoded value on textView.
If you have a scenario where your SwiftUI view looks like this:
structViewWithScroll:View{varbody:someView{ScrollView{Text("Some Text")RichTextViewRepresentable()Button(action:{}){Text("Some Other Content")}}}}
The text content contained in RichTextViewRepresentable() has separate scroll behavior from the containing ScrollView
Good solution! But some of my content got clipped if I disable scrolling.
Scrolling enabled
Scrolling disabled
My workaround is to move the change to the implementation of renderDocumentIfNeeded of RichTextViewController.
Make the text view scrollable before rendering and disable the scrolling after rendering is done.
When using
RichTextViewController
with aUIViewRepresentable
in SwiftUI, it would be helpful to be able to control whether thetextView
content is scrollable in the view controller.The issue that occurs is that if you ever want to include the
RichTextViewController
amongst other SwiftUI content, the scroll behavior is always determined by the hardcoded value ontextView
.If you have a scenario where your SwiftUI view looks like this:
The text content contained in
RichTextViewRepresentable()
has separate scroll behavior from the containingScrollView
You can find my quick implementation in my fork here:
https://github.com/CharlemagneVI/rich-text-renderer.swift/commit/b7352ce83c456c110435044ee490690d3670e2fe
The text was updated successfully, but these errors were encountered: