imzbf / md-editor-v3

Markdown editor for vue3, developed in jsx and typescript, dark theme、beautify content by prettier、render articles directly、paste or clip the picture and upload it...
https://imzbf.github.io/md-editor-v3
MIT License
1.52k stars 146 forks source link

拼字时触发compositionstart和compositionend事件失败 #589

Closed mingchiuli closed 2 months ago

mingchiuli commented 2 months ago

描述这个Bug

不知道那个版本开始出问题的,代码是这样

<template>
  <MdEditor ref="editorRef" />
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { MdEditor } from 'md-editor-v3';
import type { ExposeParam } from 'md-editor-v3';
import 'md-editor-v3/lib/style.css';

const editorRef = ref<ExposeParam>();

onMounted(() => {
  editorRef.value?.domEventHandlers({
  compositionstart: () => {
    console.log('compositionstart');
  }
});
});
</script>
Screenshot 2024-06-29 at 21 01 28

拼字时控制台不会打印compositionstart

回退到4.12.0似乎也不奏效

版本号

4.17.0

问题重现链接

No response

imzbf commented 2 months ago

https://github.com/codemirror/dev/issues/1399

codemirror最近更新出现了不少的拼字输入的bug,等待那边优化

mingchiuli commented 2 months ago

codemirror/dev#1399

codemirror最近更新出现了不少的拼字输入的bug,等待那边优化

是的,测试了下firefox是正常的

imzbf commented 2 months ago

codemirror在子版本中提交了破坏性的功能,在没有取得替换方案或者恢复的消息时,通过下面的方法对子依赖降级

在package.json中添加如下内容,并且重新安装依赖

  "resolutions": {
    "@codemirror/view": "6.27.0"
  },
imzbf commented 2 months ago

4.17.4版本禁用了编辑库的实验功能,该issue关闭