mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-10 17:24:02 +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:
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>(
|
toSlatePoint<T extends boolean>(
|
||||||
editor: ReactEditor,
|
editor: ReactEditor,
|
||||||
domPoint: DOMPoint,
|
domPoint: DOMPoint,
|
||||||
extractMatch: T
|
exactMatch: T
|
||||||
): T extends true ? Point | null : Point {
|
): T extends true ? Point | null : Point {
|
||||||
const [nearestNode, nearestOffset] = extractMatch
|
const [nearestNode, nearestOffset] = exactMatch
|
||||||
? domPoint
|
? domPoint
|
||||||
: normalizeDOMPoint(domPoint)
|
: normalizeDOMPoint(domPoint)
|
||||||
const parentNode = nearestNode.parentNode as DOMElement
|
const parentNode = nearestNode.parentNode as DOMElement
|
||||||
@@ -525,7 +525,7 @@ export const ReactEditor = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!textNode) {
|
if (!textNode) {
|
||||||
if (extractMatch) {
|
if (exactMatch) {
|
||||||
return null as T extends true ? Point | null : Point
|
return null as T extends true ? Point | null : Point
|
||||||
}
|
}
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
Reference in New Issue
Block a user