mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-20 06:01:24 +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 Key from '../utils/key'
|
||||||
import Placeholder from '../components/placeholder'
|
import Placeholder from '../components/placeholder'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
@@ -95,7 +96,7 @@ function Plugin(options = {}) {
|
|||||||
const char = prev.get(startOffset)
|
const char = prev.get(startOffset)
|
||||||
const chars = prev
|
const chars = prev
|
||||||
.slice(0, startOffset)
|
.slice(0, startOffset)
|
||||||
.push(char.merge({ text: e.data }))
|
.push(Character.create({ text: e.data, marks: char && char.marks }))
|
||||||
.concat(prev.slice(startOffset))
|
.concat(prev.slice(startOffset))
|
||||||
|
|
||||||
// Determine what the characters should be, if not natively inserted.
|
// Determine what the characters should be, if not natively inserted.
|
||||||
|
Reference in New Issue
Block a user