提交 edfe0248 编写于 作者: M Matthew Smith 提交者: Chris Bracken

13771 - iOS dictation bug (#6607)

According to the iOS docs, implementing
`- (id)insertDictationResultPlaceholder`

```Implementation of this method is optional but can be done when you want to provide a specific rectangle for the placeholder animation while the dictation results are being processed. ```

If you do not implement this method, UIKit will insert a default placeholder of 10 whitespace characters. By overriding this, no placeholder text will be inserted. If you implement the `insertDictationResultPlaceholder`, you must implement
`- (void)removeDictationResultPlaceholder:(id)placeholder willInsertResult:(BOOL)willInsertResult`
上级 cadf4405
......@@ -289,6 +289,13 @@ static UIReturnKeyType ToUIReturnKeyType(NSString* inputType) {
}
}
- (id)insertDictationResultPlaceholder {
return @"";
}
- (void)removeDictationResultPlaceholder:(id)placeholder willInsertResult:(BOOL)willInsertResult {
}
- (NSString*)textInRange:(UITextRange*)range {
NSRange textRange = ((FlutterTextRange*)range).range;
return [self.text substringWithRange:textRange];
......@@ -297,7 +304,6 @@ static UIReturnKeyType ToUIReturnKeyType(NSString* inputType) {
- (void)replaceRange:(UITextRange*)range withText:(NSString*)text {
NSRange replaceRange = ((FlutterTextRange*)range).range;
NSRange selectedRange = _selectedTextRange.range;
// Adjust the text selection:
// * reduce the length by the intersection length
// * adjust the location by newLength - oldLength + intersectionLength
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册