Prettified Code!
This commit is contained in:
@@ -9,7 +9,7 @@ export function getCaretPosition(node) {
|
|||||||
var range = window.getSelection().getRangeAt(0),
|
var range = window.getSelection().getRangeAt(0),
|
||||||
preCaretRange = range.cloneRange(),
|
preCaretRange = range.cloneRange(),
|
||||||
caretPosition,
|
caretPosition,
|
||||||
tmp = document.createElement("div");
|
tmp = document.createElement('div');
|
||||||
|
|
||||||
preCaretRange.selectNodeContents(node);
|
preCaretRange.selectNodeContents(node);
|
||||||
preCaretRange.setEnd(range.endContainer, range.endOffset);
|
preCaretRange.setEnd(range.endContainer, range.endOffset);
|
||||||
@@ -100,7 +100,7 @@ export function convertToText(str = '') {
|
|||||||
You would call this when a user pastes from
|
You would call this when a user pastes from
|
||||||
the clipboard into a `contenteditable` area.
|
the clipboard into a `contenteditable` area.
|
||||||
*/
|
*/
|
||||||
export function convertOnPaste(event = { preventDefault() { } }, emojiList) {
|
export function convertOnPaste(event = { preventDefault() {} }, emojiList) {
|
||||||
// Prevent paste.
|
// Prevent paste.
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user