HarmonyOS 使用中转站 拖入富文本区域没有识别到文字?

部分代码:

onIMEInputComplete((value: RichEditorTextSpanResult) => {
  let spansText: string =  ,
  // console.Log(value.value + '  , value.value.Length)
  if (this.textValue.Length == 0 && (value.value  . . |l value.value == 'In')){ // 直接输入空格、换行 不得行
    this.richEditorController.deleteSpans ()
  } else {
    this.richEditorController.getSpans().forEach((item, index) => { // addBuilderSpan getSpans 获取不到
      let itemText = (item as RichEditorTextSpanResult).value
      if (itemText == undefined) {
        spansText += ,
      } else {
        spansText += itemText
        this.textValue = spansText
          .onDeleteComplete(O) => {
          let offset = this.richEditorController.getCaretOffset()
          // console.info(offset +'位置信息:光标-=-
          时 审影息码:+(0J0181Gex0110 8T41)AgTbupJas NOSr)OJuT aLOSu0O //
          let findIndex = -1
          this.clickableinfo?.forEach((item, index) => {
阅读 568
1 个回答

请在onDidChange回调中使用getSpans方法进行计算

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进