mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-18 21:21:21 +02:00
fix character insertion when first in node, closes #182
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
|
||||
import Character from '../models/character'
|
||||
import Key from '../utils/key'
|
||||
import Placeholder from '../components/placeholder'
|
||||
import React from 'react'
|
||||
@@ -95,7 +96,7 @@ function Plugin(options = {}) {
|
||||
const char = prev.get(startOffset)
|
||||
const chars = prev
|
||||
.slice(0, startOffset)
|
||||
.push(char.merge({ text: e.data }))
|
||||
.push(Character.create({ text: e.data, marks: char && char.marks }))
|
||||
.concat(prev.slice(startOffset))
|
||||
|
||||
// Determine what the characters should be, if not natively inserted.
|
||||
|
Reference in New Issue
Block a user