Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
yangchenggong1_wd
2024-05-18 16:56:44 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
51a45a78c893044fab123c5ad8c9c773ead1c7c3
51a45a78
1 parent
bc4e3d31
fix:bug[17197] 搜索-取消清空搜索记录,不应弹出键盘
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchHistoryComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchComponent.ets
View file @
51a45a7
...
...
@@ -110,6 +110,10 @@ export struct SearchComponent {
this.searchHistoryData = SearcherAboutDataModel.getSearchHistoryData()
}
stopInput(){
this.controller.stopEditing()
}
build() {
Column() {
this.searchInputComponent()
...
...
@@ -117,7 +121,7 @@ export struct SearchComponent {
Scroll(this.scroller) {
Column() {
if(this.searchHistoryData!=null && this.searchHistoryData.length>0){
SearchHistoryComponent({ searchHistoryData: $searchHistoryData, onDelHistory: (): void => this.getSearchHistoryData(),onGetSearchRes: (item,index): void => this.getSearchHistoryResData(item,index) })
SearchHistoryComponent({ searchHistoryData: $searchHistoryData, onDelHistory: (): void => this.getSearchHistoryData(),onGetSearchRes: (item,index): void => this.getSearchHistoryResData(item,index)
,onCloseInput : (): void => this.stopInput()
})
}
if(this.searchHistoryData.length>0){
...
...
@@ -257,7 +261,6 @@ export struct SearchComponent {
.textFont({ size: "27lpx", weight: "400lpx" })
// .defaultFocus(true)
.id("searchId")
.focusable(true)
.searchIcon({
size:0
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchHistoryComponent.ets
View file @
51a45a7
...
...
@@ -8,11 +8,14 @@ import { MyCustomDialog } from '../reusable/MyCustomDialog'
@Component
export struct SearchHistoryComponent{
@Link searchHistoryData:SearchHistoryItem[]
onCloseInput?: () => void;
onDelHistory?: () => void;
onGetSearchRes?: (item:string,index:number) => void;
dialogController: CustomDialogController = new CustomDialogController({
builder: MyCustomDialog({
cancel: this.onCancel,
cancel: () => {
this.onCancel()
},
confirm: () => {
this.onAccept()
},
...
...
@@ -33,6 +36,9 @@ export struct SearchHistoryComponent{
}
onCancel() {
if (this.onCloseInput !== undefined) {
this.onCloseInput()
}
console.info('Callback when the first button is clicked')
}
...
...
Please
register
or
login
to post a comment