Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using MarkupEditor in a scrollview with other ui components #213

Open
JohnKuan opened this issue Sep 2, 2024 · 1 comment
Open

Using MarkupEditor in a scrollview with other ui components #213

JohnKuan opened this issue Sep 2, 2024 · 1 comment

Comments

@JohnKuan
Copy link
Contributor

JohnKuan commented Sep 2, 2024

Hi @stevengharris, would like to know if you have considered whether MarkupEditorView could be in a Scrollview, along side with other UI components such as a TextField etc, in the ScrollView.

In my example project, I am using it with a couple of TextFields and the MarkupEditorView is the last component at the bottom. I am aware that in that scenario, it should require turning off the scrolling on the webView of MarkupEditorView, but another concern will be to determine the intrinsic size of the webView.

@stevengharris
Copy link
Owner

No, I haven't thought about it directly. I was using many MarkupWKWebViews in a List for quite a while, which worked okay from a scrolling and even view re-use perspective, but ultimately I replaced this with the approach in #178. I'm using this approach to put many contentEditable divs along with non-editable ones in a single MarkupWKWebview so that I can scroll the overall page and let the web view machinery deal with the sizing/flow. I'm not sure if this kind of approach would work for you, since the items in the web view are all HTML entities, not iOS views, but it might be something to consider.

I do think the only times I've done something similar to what you're talking about is when the MarkupWKWebView itself is non-scrolling by autosizing. Since I'm not using a list of autosized views any more, I'd have to go digging a bit to reconstruct exactly how I dealt with it. I believe I just used the MarkupDelegate.markup(_:heightDidChange:) callback to adjust the frame size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants