mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-04-21 13:51:59 +02:00
chore(slate-react) typo - rename extractMatch to exactMatch (#4271)
* Fix typo - rename extractMatch to exactMatch * update changelog * update changelog
This commit is contained in:
parent
294d5120ae
commit
ff267767f6
5
.changeset/shaggy-falcons-fry.md
Normal file
5
.changeset/shaggy-falcons-fry.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
'slate-react': patch
|
||||
---
|
||||
|
||||
Fixed typo: Renamed `toSlatePoint` argument `extractMatch` to `exactMatch`
|
@ -449,9 +449,9 @@ export const ReactEditor = {
|
||||
toSlatePoint<T extends boolean>(
|
||||
editor: ReactEditor,
|
||||
domPoint: DOMPoint,
|
||||
extractMatch: T
|
||||
exactMatch: T
|
||||
): T extends true ? Point | null : Point {
|
||||
const [nearestNode, nearestOffset] = extractMatch
|
||||
const [nearestNode, nearestOffset] = exactMatch
|
||||
? domPoint
|
||||
: normalizeDOMPoint(domPoint)
|
||||
const parentNode = nearestNode.parentNode as DOMElement
|
||||
@ -525,7 +525,7 @@ export const ReactEditor = {
|
||||
}
|
||||
|
||||
if (!textNode) {
|
||||
if (extractMatch) {
|
||||
if (exactMatch) {
|
||||
return null as T extends true ? Point | null : Point
|
||||
}
|
||||
throw new Error(
|
||||
|
Loading…
x
Reference in New Issue
Block a user