mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
Fix composed character on multiline EditBox (#11263)
Co-authored-by: pandamicro <lphuabin@gmail.com>
This commit is contained in:
@@ -222,8 +222,10 @@ void onParentViewTouched(const cc::CustomEvent &touchEvent){
|
||||
return;
|
||||
|
||||
// check length limit after text changed, a little rude
|
||||
if (textView.text.length > g_maxLength)
|
||||
textView.text = [textView.text substringToIndex:g_maxLength];
|
||||
if (textView.text.length > g_maxLength) {
|
||||
NSRange rangeIndex = [textView.text rangeOfComposedCharacterSequenceAtIndex:g_maxLength];
|
||||
textView.text = [textView.text substringToIndex:rangeIndex.location];
|
||||
}
|
||||
tViewOnView.text = textView.text;
|
||||
tViewOnToolbar.text = textView.text;
|
||||
callJSFunc("input", [textView.text UTF8String]);
|
||||
|
||||
Reference in New Issue
Block a user