diff --git a/frameworks/core/components_ng/pattern/search/search_pattern.cpp b/frameworks/core/components_ng/pattern/search/search_pattern.cpp index 93010d1a198c222ea14ec4c44c156d3793ee54d4..d91eb9f52d0573b5a0eed6380b94034a140e07f4 100644 --- a/frameworks/core/components_ng/pattern/search/search_pattern.cpp +++ b/frameworks/core/components_ng/pattern/search/search_pattern.cpp @@ -1703,7 +1703,9 @@ void SearchPattern::ToJsonValueForTextField(std::unique_ptr& json, co "fontSize", textFieldLayoutProperty->GetFontSizeValue(searchTheme->GetFontSize()).ToString().c_str()); textFontJson->Put("fontStyle", textFieldPattern->GetItalicFontStyle() == Ace::FontStyle::NORMAL ? "FontStyle.Normal" : "FontStyle.Italic"); - textFontJson->Put("fontWeight", V2::ConvertWrapFontWeightToStirng(textFieldPattern->GetFontWeight()).c_str()); + textFontJson->Put("fontWeight", + V2::ConvertWrapFontWeightToStirng(textFieldLayoutProperty->GetFontWeightValue(searchTheme->GetFontWeight())) + .c_str()); textFontJson->Put("fontFamily", textFieldPattern->GetFontFamily().c_str()); json->PutExtAttr("textFont", textFontJson->ToString().c_str(), filter); json->PutExtAttr("copyOption", diff --git a/frameworks/core/components_ng/pattern/text_field/text_field_pattern.cpp b/frameworks/core/components_ng/pattern/text_field/text_field_pattern.cpp index e5426ffa654a9f7c860a5cb1cbbbbfc92285cb3a..ea64673c8ef3a2f0112384bc841d28854d0f3d09 100644 --- a/frameworks/core/components_ng/pattern/text_field/text_field_pattern.cpp +++ b/frameworks/core/components_ng/pattern/text_field/text_field_pattern.cpp @@ -7018,7 +7018,7 @@ std::string TextFieldPattern::GetPlaceholderFont() const jsonValue->Put("weight", "900"); break; default: - jsonValue->Put("fontWeight", V2::ConvertWrapFontWeightToStirng(weight).c_str()); + jsonValue->Put("weight", V2::ConvertWrapFontWeightToStirng(weight).c_str()); } auto family = layoutProperty->GetPlaceholderFontFamilyValue({ "sans-serif" }); std::string jsonFamily = ConvertFontFamily(family);