mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 23:21:05 +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.start,
|
||||||
miscTextConfig.value().range.end
|
miscTextConfig.value().range.end
|
||||||
};
|
};
|
||||||
if (lastCursorRange_ == miscTextConfigRange && !forceUpdate) {
|
if (!forceUpdate && lastCursorRange_ == miscTextConfigRange &&
|
||||||
|
lastTextValue_ == contentController_->GetTextValue()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
lastCursorRange_.Set(miscTextConfig.value().range.start, miscTextConfig.value().range.end);
|
lastCursorRange_.Set(miscTextConfig.value().range.start, miscTextConfig.value().range.end);
|
||||||
|
lastTextValue_ = contentController_->GetTextValue();
|
||||||
MiscServices::CursorInfo cursorInfo = miscTextConfig.value().cursorInfo;
|
MiscServices::CursorInfo cursorInfo = miscTextConfig.value().cursorInfo;
|
||||||
MiscServices::InputMethodController::GetInstance()->OnCursorUpdate(cursorInfo);
|
MiscServices::InputMethodController::GetInstance()->OnCursorUpdate(cursorInfo);
|
||||||
MiscServices::InputMethodController::GetInstance()->OnSelectionChange(
|
MiscServices::InputMethodController::GetInstance()->OnSelectionChange(
|
||||||
|
@ -1963,6 +1963,7 @@ private:
|
|||||||
int32_t previewTextEnd_ = -1;
|
int32_t previewTextEnd_ = -1;
|
||||||
std::string bodyTextInPreivewing_;
|
std::string bodyTextInPreivewing_;
|
||||||
PreviewRange lastCursorRange_ = {};
|
PreviewRange lastCursorRange_ = {};
|
||||||
|
std::string lastTextValue_ = "";
|
||||||
bool showKeyBoardOnFocus_ = true;
|
bool showKeyBoardOnFocus_ = true;
|
||||||
bool isTextSelectionMenuShow_ = true;
|
bool isTextSelectionMenuShow_ = true;
|
||||||
bool isMoveCaretAnywhere_ = false;
|
bool isMoveCaretAnywhere_ = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user