!34410 notify onselectionchange when touch

Merge pull request !34410 from 末日拿铁/master
This commit is contained in:
openharmony_ci 2024-06-01 02:06:32 +00:00 committed by Gitee
commit d55ad218e1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 5 additions and 4 deletions

View File

@ -452,8 +452,8 @@ void TextFieldPattern::BeforeCreateLayoutWrapper()
break;
}
case InputOperation::SET_PREVIEW_TEXT:
SetPreviewTextOperation(previewTextOperation.front());
previewTextOperation.pop();
SetPreviewTextOperation(previewTextOperation_.front());
previewTextOperation_.pop();
break;
case InputOperation::SET_PREVIEW_FINISH:
FinishTextPreviewOperation();
@ -1664,6 +1664,7 @@ void TextFieldPattern::UpdateCaretByTouchMove(const TouchEventInfo& info)
} else {
selectController_->UpdateCaretInfoByOffset(touchOffset);
}
UpdateCaretInfoToController();
auto host = GetHost();
CHECK_NULL_VOID(host);
host->MarkDirtyNode(PROPERTY_UPDATE_RENDER);
@ -7113,7 +7114,7 @@ int32_t TextFieldPattern::SetPreviewText(const std::string &previewValue, const
auto host = GetHost();
CHECK_NULL_RETURN(host, PREVIEW_NULL_POINTER);
inputOperations_.emplace(InputOperation::SET_PREVIEW_TEXT);
previewTextOperation.emplace(info);
previewTextOperation_.emplace(info);
CloseSelectOverlay(true);
ScrollToSafeArea();
host->MarkDirtyNode(PROPERTY_UPDATE_MEASURE_SELF_AND_PARENT);

View File

@ -1666,7 +1666,7 @@ private:
Dimension previewUnderlineWidth_ = 2.0_vp;
bool hasSupportedPreviewText_ = true;
bool hasPreviewText_ = false;
std::queue<PreviewTextInfo> previewTextOperation;
std::queue<PreviewTextInfo> previewTextOperation_;
int32_t previewTextStart_ = -1;
int32_t previewTextEnd_ = -1;
bool showKeyBoardOnFocus_ = true;