Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(editor): fix the compatibility issue of cjk ime #150

Merged
merged 1 commit into from
Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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