xugenyuan

ref |> 按华为沟通结论,调整评论输入框键盘消失方法

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
import { inputMethodEngine } from '@kit.IMEKit'
import { inputMethod, inputMethodEngine } from '@kit.IMEKit'
import { commentInfo } from 'wdBean/Index'
import { VoiceRecoginizer } from 'wdHwAbility'
import { Logger, ToastUtils } from 'wdKit/Index'
... ... @@ -8,6 +8,7 @@ import { publishCommentModel } from '../model/PublishCommentModel'
import commentViewModel from '../viewmodel/CommentViewModel'
import { VoiceInputView } from './VoiceInputView'
import { common, UIAbility } from '@kit.AbilityKit'
import { BusinessError } from '@kit.BasicServicesKit'
const TAG = "CommentInputDialog"
... ... @@ -154,7 +155,19 @@ export struct CommentCustomDialog {
this.voiceSwitch = !this.voiceSwitch
this.emojiSwitch = false
if (this.voiceSwitch) {
this.textInputController.stopEditing()
// 按沟通结果,调整隐藏键盘方法
// http://192.168.1.3:8080/zentao/bug-view-20473.html
// this.textInputController.stopEditing()
inputMethod.getController().hideTextInput((err: BusinessError) => {
if (err) {
console.error(`Failed to hideTextInput: ${JSON.stringify(err)}`);
return;
}
// console.log('Succeeded in hiding text input.');
})
// this.showKeyboardOnFocus = false
// focusControl.requestFocus("textAreaId") // 弹起键盘
} else {
focusControl.requestFocus("textAreaId") // 弹起键盘
// this.textInputController.caretPosition(this.textInputController.getTextContentRect().x)
... ... @@ -170,7 +183,16 @@ export struct CommentCustomDialog {
this.emojiSwitch = !this.emojiSwitch
this.voiceSwitch = false
if (this.emojiSwitch) {
this.textInputController.stopEditing()
// 按沟通结果,调整隐藏键盘方法
// http://192.168.1.3:8080/zentao/bug-view-20473.html
// this.textInputController.stopEditing()
inputMethod.getController().hideTextInput((err: BusinessError) => {
if (err) {
console.error(`Failed to hideTextInput: ${JSON.stringify(err)}`);
return;
}
// console.log('Succeeded in hiding text input.');
})
} else {
focusControl.requestFocus("textAreaId") // 弹起键盘
// this.textInputController.caretPosition(this.textInputController.getTextContentRect().x)
... ...