mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 15:10:30 +00:00
!45039 fix 光标范围没变化 内容变化时候没有触发框架的onSelectionChange
Merge pull request !45039 from tzcurtain/caret_fix2
This commit is contained in:
commit
929218af9e
@ -710,11 +710,12 @@ void TextFieldPattern::UpdateCaretInfoToController(bool forceUpdate)
|
||||
miscTextConfig.value().range.start,
|
||||
miscTextConfig.value().range.end
|
||||
};
|
||||
if (lastCursorRange_ == miscTextConfigRange && !forceUpdate) {
|
||||
if (!forceUpdate && lastCursorRange_ == miscTextConfigRange &&
|
||||
lastTextValue_ == contentController_->GetTextValue()) {
|
||||
return;
|
||||
}
|
||||
lastCursorRange_.Set(miscTextConfig.value().range.start, miscTextConfig.value().range.end);
|
||||
|
||||
lastTextValue_ = contentController_->GetTextValue();
|
||||
MiscServices::CursorInfo cursorInfo = miscTextConfig.value().cursorInfo;
|
||||
MiscServices::InputMethodController::GetInstance()->OnCursorUpdate(cursorInfo);
|
||||
MiscServices::InputMethodController::GetInstance()->OnSelectionChange(
|
||||
|
@ -1963,6 +1963,7 @@ private:
|
||||
int32_t previewTextEnd_ = -1;
|
||||
std::string bodyTextInPreivewing_;
|
||||
PreviewRange lastCursorRange_ = {};
|
||||
std::string lastTextValue_ = "";
|
||||
bool showKeyBoardOnFocus_ = true;
|
||||
bool isTextSelectionMenuShow_ = true;
|
||||
bool isMoveCaretAnywhere_ = false;
|
||||
|
Loading…
Reference in New Issue
Block a user