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
xugenyuan
2024-05-25 16:08:31 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
87595f1d44e869224512c3b4bc1a655f22c8adab
87595f1d
1 parent
b8805a6c
ref |> 解决评论输入框默认弹起键盘问题
Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentCustomDialog.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentCustomDialog.ets
View file @
87595f1
...
...
@@ -17,8 +17,6 @@ export struct CommentCustomDialog {
@State positionInfo: CaretOffset = { index: 0, x: 0, y: 0 }
aboutToAppear(): void {
// this.textInputController.caretPosition(0)
}
publishCommentRequest() {
...
...
@@ -51,12 +49,20 @@ export struct CommentCustomDialog {
controller: this.textInputController,
text: this.publishCommentModel.commentContent
})
.id("textAreaId")
.defaultFocus(true) // 获取默认焦点
.enableKeyboardOnFocus(true)
.height('100%')
.width('100%')
.backgroundColor($r('app.color.color_transparent'))
.onChange(value => {
this.publishCommentModel.commentContent = value;
})
.onFocus(() => {
if (this.emojiSwitch) {
this.emojiSwitch = false
}
})
}
.backgroundColor('#F9F9F9')
// .width('100%')
...
...
@@ -81,6 +87,7 @@ export struct CommentCustomDialog {
if (this.emojiSwitch) {
this.textInputController.stopEditing()
} else {
focusControl.requestFocus("textAreaId") // 弹起键盘
// this.textInputController.caretPosition(this.textInputController.getTextContentRect().x)
}
...
...
Please
register
or
login
to post a comment