From ea039e09b5f28ecf4b5a5f97acc118974c388167 Mon Sep 17 00:00:00 2001 From: Liyuan Li Date: Sat, 1 Aug 2020 16:35:18 +0800 Subject: [PATCH] :art: fix #669 --- CHANGELOG.md | 1 + demo/index.js | 2 +- src/ts/wysiwyg/toolbarEvent.ts | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bc2f98d8..1b0afd2de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -79,6 +79,7 @@ ### v3.4.2 / 2020-08-xx +* [669](https://github.com/Vanessa219/vditor/issues/669) links problem(Wysiwyg) `改进功能` * [667](https://github.com/Vanessa219/vditor/issues/667) lists (SV) `修复缺陷` * [446](https://github.com/Vanessa219/vditor/issues/446) 改进复制粘贴链接体验 `引入特性` diff --git a/demo/index.js b/demo/index.js index a4fcffe76..0f3622d9f 100644 --- a/demo/index.js +++ b/demo/index.js @@ -53,7 +53,7 @@ window.vditor = new Vditor('vditor', { // _lutePath: `http://192.168.0.107:9090/lute.min.js?${new Date().getTime()}`, _lutePath: 'src/js/lute/lute.min.js', toolbar, - mode: 'sv', + mode: 'wysiwyg', height: window.innerHeight + 100, outline: true, debugger: true, diff --git a/src/ts/wysiwyg/toolbarEvent.ts b/src/ts/wysiwyg/toolbarEvent.ts index ec33d5e4a..7562b4334 100644 --- a/src/ts/wysiwyg/toolbarEvent.ts +++ b/src/ts/wysiwyg/toolbarEvent.ts @@ -227,6 +227,11 @@ export const toolbarEvent = (vditor: IVditor, actionBtn: Element, event: Event) range.surroundContents(node); range.insertNode(node); setSelectionFocus(range); + genAPopover(vditor, node); + const textInputElements = vditor.wysiwyg.popover.querySelectorAll("input"); + textInputElements[0].value = node.innerText; + textInputElements[1].focus(); + useHighlight = false; } } else if (commandName === "table") { let tableHTML = `
col1col2col3
`;