Skip to content

Commit

Permalink
fix(editor): fix the compatibility issue of cjk ime (#150)
Browse files Browse the repository at this point in the history
Fixed #82
  • Loading branch information
lyngai committed Feb 28, 2022
1 parent 999581e commit 05703a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ export default class Editor {
extraKeys: { Enter: 'newlineAndIndentContinueMarkdownList' }, // 增加markdown回车自动补全
matchTags: { bothTags: true }, // 自动高亮选中的闭合html标签
placeholder: '',
// 设置为 contenteditable 对输入法定位更友好
// 但已知会影响某些悬浮菜单的定位,如粘贴选择文本或markdown模式的菜单
// inputStyle: 'contenteditable',
},
toolbars: {},
onKeydown() {},
Expand Down
5 changes: 5 additions & 0 deletions src/sass/cherry.scss
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,11 @@
font-family: $fontFamily;
background: $editorBg;
color: $fontColor;
// codemirror 依赖隐藏的 textarea 计算行高,这里将字体大小设置为行高,避免输入法遮挡内容
// Fixed https://github.com/Tencent/cherry-markdown/issues/82
textarea {
font-size: $lineHeight;
}
}

.CodeMirror-lines {
Expand Down

0 comments on commit 05703a3

Please sign in to comment.