260722_01_ENH: KriEditorWysiwyg 버그 수정
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "kri-ui-registry",
|
||||
"version": "0.9.0",
|
||||
"version": "0.9.1",
|
||||
"private": true,
|
||||
"description": "KRI internal shadcn UI registry",
|
||||
"scripts": {
|
||||
|
||||
@@ -483,10 +483,11 @@ export function KriEditorWysiwyg(props: KriEditorProps) {
|
||||
if (value == null) return;
|
||||
|
||||
const current = editor.getHTML();
|
||||
const normalizedValue = value || "<p></p>";
|
||||
|
||||
if (value !== current && value !== optimisticHtmlRef.current) {
|
||||
if (normalizedValue !== current && normalizedValue !== optimisticHtmlRef.current) {
|
||||
// 이미지가 포함된 HTML 업데이트면, 아예 editor를 새로 생성
|
||||
editor.commands.setContent(value, {
|
||||
editor.commands.setContent(normalizedValue, {
|
||||
emitUpdate: false,
|
||||
parseOptions: {preserveWhitespace: "full"},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user