Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ bool TextInputView::SetPropImpl(const std::string &propKey, const HippyValue &pr
isListenKeyboardWillHide_ = HRValueUtils::GetBool(propValue, false);
CheckAndAddKeyboardListener();
return true;
} else if (propKey == "contentSizeChange") {
} else if (propKey == "contentsizechange") {
isListenContentSizeChange_ = HRValueUtils::GetBool(propValue, false);
return true;
} else if (propKey == "keypress") {
Expand Down Expand Up @@ -447,7 +447,7 @@ void TextInputView::SetText(const HippyValueArrayType &params){
auto& str = HRValueUtils::GetString(params[0]);
value_ = str;
GetTextNode().SetTextContent(value_.value());

// 注释 SetTextSelection 原因:
// 设置了也没效果,还偶现 OHOS::Ace::NG::UINode::MountToParent 里空指针 crash。
// int32_t len = (int32_t)str.length();
Expand Down Expand Up @@ -599,14 +599,14 @@ void TextInputView::OnKeyPress(const std::string &keyString) {
if(!isListenKeyPress_) {
return;
}

std::string resultKeyString = keyString;
if (keyString == " ") {
resultKeyString = "space";
} else if (keyString == "\n") {
resultKeyString = "enter";
}

HippyValueObjectType params;
params["key"] = resultKeyString;
const std::shared_ptr<HippyValue> obj = std::make_shared<HippyValue>(params);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ public void setOnKeyboardWillHide(HippyTextInput hippyTextInput, boolean enable)
hippyTextInput.setEventListener(enable, HippyTextInput.EVENT_KEYBOARD_HIDE);
}

@HippyControllerProps(name = "contentSizeChange", defaultType = HippyControllerProps.BOOLEAN)
@HippyControllerProps(name = "contentsizechange", defaultType = HippyControllerProps.BOOLEAN)
public void setOnContentSizeChange(HippyTextInput hippyTextInput, boolean contentSizeChange) {
hippyTextInput.setOnContentSizeChange(contentSizeChange);
}
Expand Down
Loading