From 0a1eb8cdd891cc0205c6d839d7671b1ccb4ea8da Mon Sep 17 00:00:00 2001 From: Mauro <34335419+Velin92@users.noreply.github.com> Date: Thu, 8 Feb 2024 11:45:06 +0100 Subject: [PATCH] [iOS] Fix UI Tests (#933) --- .../Components/WysiwygComposerView/WysiwygComposerView.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platforms/ios/lib/WysiwygComposer/Sources/WysiwygComposer/Components/WysiwygComposerView/WysiwygComposerView.swift b/platforms/ios/lib/WysiwygComposer/Sources/WysiwygComposer/Components/WysiwygComposerView/WysiwygComposerView.swift index 19164f30d..cf4ad5b2f 100644 --- a/platforms/ios/lib/WysiwygComposer/Sources/WysiwygComposer/Components/WysiwygComposerView/WysiwygComposerView.swift +++ b/platforms/ios/lib/WysiwygComposer/Sources/WysiwygComposer/Components/WysiwygComposerView/WysiwygComposerView.swift @@ -130,6 +130,8 @@ struct UITextViewWrapper: UIViewRepresentable { textStorage.addLayoutManager(layoutManager) layoutManager.addTextContainer(textContainer) let textView = WysiwygTextView(frame: .zero, textContainer: textContainer) + // Assign the textView to the view model ASAP + viewModel.textView = textView textView.accessibilityIdentifier = "WysiwygComposer" textView.font = UIFont.preferredFont(forTextStyle: .body) textView.autocapitalizationType = .sentences @@ -144,7 +146,6 @@ struct UITextViewWrapper: UIViewRepresentable { textView.clipsToBounds = false textView.tintColor = UIColor.tintColor textView.wysiwygDelegate = context.coordinator - viewModel.textView = textView viewModel.updateCompressedHeightIfNeeded() return textView }