1
0
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:
Ian Storm Taylor
2016-07-27 11:38:57 -07:00
parent 5313b3be2e
commit eebb0bd985

View File

@@ -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.