This repository has been archived by the owner on Mar 4, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Possible fix for 18890 (facebook#19687)
Summary: Potential fixes for 18890. The issue was that when the setAttributedText method in RCTBaseTextInputView.m is called it does two main things: Check that the attributed text that it receives is equal to the existing attributed text in the underlying backed up view ( backedTextInputView) If not set the attributed text of the backed up view to the value passed into the method. This kills the dictation as it is effectively the equivalent of typing in the backed up text view. self.backedTextInputView.attributedText = attributedText; is the problem. It kills the dictation. It may have other effects as well. In all cases I have seen the underlying text of the attributed string that is passed in the same as the text in the backedTextInputView, what was said to the dictation; however the attributes are different, which causes the isEqualToAttributedString: check to fail and thus the update happens, and the keyboard is killed. Fix is to test for the underlying string equality not the attributed string equality when the input mode is dictation. By necessity this had to be an integration test on an existing application. To test I enabled the keyboard and started the dictation. It worked with this fixes and not without. Will upload videos later. This might break attributes on dictation, as it is happening. However anything set on the existing underlying text view should hold. [IOS] [BUG] [Textinput] fixed an issue where the keyboard dictation ended abruptly. Closes facebook#19687 Differential Revision: D8450590 Pulled By: hramos fbshipit-source-id: f97084131f98e9e0ed1f32111afc0f9f510f3b3b
- Loading branch information