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

Support multiple editable areas in a single document #195

Merged
merged 45 commits into from
Mar 26, 2024
Merged

Conversation

stevengharris
Copy link
Owner

No description provided.

…ripts load string-based scripts independently.
Conflicts:
	MarkupEditor/MarkupCoordinator.swift
	MarkupEditor/MarkupWKWebView.swift
	MarkupEditor/MarkupWKWebViewRepresentable.swift
@thomasmfinalcad
Copy link

Hello @stevengharris Actually i've an issue with a multiple instances of MarkupEditor and the MU.getSelectionState.
It returns all states so when I listen the delegate to handle changed it are all returned and not only the wanted one.
I good hope that it's PR could solve that. Do you know when it' will be release on main ?
Regards,

@stevengharris
Copy link
Owner Author

I am using a branch with these changes in an app I'm working on, so I was waiting until I was surer about it being complete and not break anything the tests don't cover. I'm feeling pretty good on both of those fronts, so I can merge soon. Thanks for letting me know you are interested in it. I am not sure if you saw the discussion I opened about it. I also need to provide some documentation :-)

I'm not sure it's going to address your problem, though. In this approach, there is still one "editor" div that contains everything, and selection changes anywhere within it still call back to the one MarkupCoordinator for the view which in turn will invoke the delegate methods for the delegate that is assigned to the view. If you use the same delegate for multiple views (which I would do, a superview being the delegate for the MarkupWKWebViews it holds), then you have to filter the callbacks based on which view they apply to.

On the other hand, if you want to or can use a single MarkupWebView with multiple editable areas, then this PR will definitely let you do that, since it will include the ID of the div being edited in the callback.

@stevengharris stevengharris merged commit 98bde16 into main Mar 26, 2024
1 check passed
@stevengharris stevengharris deleted the editableAreas branch April 24, 2024 16:41
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

Successfully merging this pull request may close these issues.

None yet

2 participants