Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

iOS: re-rendering RTE will make the composer not interactable #930

Closed
Velin92 opened this issue Feb 2, 2024 · 0 comments · Fixed by #931
Closed

iOS: re-rendering RTE will make the composer not interactable #930

Velin92 opened this issue Feb 2, 2024 · 0 comments · Fixed by #931

Comments

@Velin92
Copy link
Member

Velin92 commented Feb 2, 2024

This issue is what causes:
element-hq/element-x-ios#2364

The issue is caused by the fact that the makeUIView function is not instantiating the view, but is actually just taking the current textView reference in the WysiwygViewModel.

Since on El-X when rotating the screen and switching from a split view to a stack view and viceversa, we regenerate the view, but we keep the same object models to restore their states, what happens is that the new re-rendered SwiftUI view embedding the text view is reusing the instance from the previous view hierarchy, causing it to break its frame.

The makeUIView should actually be the one responsible of instantiating the UIKit view since its responsible of managing the view in the view hierarchy (even the documentation specifies that this function should be the one responsible of instantiating the view object in the first place).
We might need to re-architecture a bit the iOS side of RTE to allow remove the depency that has been created between the view model and the UIKit text view.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
1 participant