Skip to content

Commit

Permalink
Merge pull request #3576 from udecode/fix/completion
Browse files Browse the repository at this point in the history
Fix renderBelowNodes make cursor position incorrect.
  • Loading branch information
felixfeng33 authored Sep 24, 2024
2 parents af808ba + 01523c1 commit 3b22f82
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/hip-toys-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@udecode/plate-indent-list': patch
---

Fix cursor possition issue.
10 changes: 4 additions & 6 deletions packages/indent-list/src/react/renderIndentListBelowNodes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,14 @@ export const renderIndentListBelowNodes = (

const List = isOrdered ? 'ol' : 'ul';

const {
liComponent: Li = (liProps) => <li>{liProps.children}</li>,
markerComponent: Marker = () => null,
} = listOptions;
const { liComponent: Li, markerComponent: Marker = () => null } =
listOptions;

return (
<List className={className} style={style} start={listStart}>
<Marker {...props} />

<Li {...props}>{children}</Li>
{/* FIX: cursor position issue */}
{Li ? <Li {...props}>{children}</Li> : <li>{children}</li>}
</List>
);
};
Expand Down
20 changes: 10 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6126,13 +6126,13 @@ __metadata:
languageName: unknown
linkType: soft

"@udecode/plate-csv@npm:38.0.6, @udecode/plate-csv@workspace:^, @udecode/plate-csv@workspace:packages/csv":
"@udecode/plate-csv@npm:38.0.8, @udecode/plate-csv@workspace:^, @udecode/plate-csv@workspace:packages/csv":
version: 0.0.0-use.local
resolution: "@udecode/plate-csv@workspace:packages/csv"
dependencies:
"@types/papaparse": "npm:^5.3.14"
"@udecode/plate-common": "workspace:^"
"@udecode/plate-table": "npm:38.0.6"
"@udecode/plate-table": "npm:38.0.8"
papaparse: "npm:^5.4.1"
peerDependencies:
"@udecode/plate-common": ">=38.0.6"
Expand Down Expand Up @@ -6215,7 +6215,7 @@ __metadata:
languageName: unknown
linkType: soft

"@udecode/plate-docx@npm:38.0.6, @udecode/plate-docx@workspace:^, @udecode/plate-docx@workspace:packages/docx":
"@udecode/plate-docx@npm:38.0.8, @udecode/plate-docx@workspace:^, @udecode/plate-docx@workspace:packages/docx":
version: 0.0.0-use.local
resolution: "@udecode/plate-docx@workspace:packages/docx"
dependencies:
Expand All @@ -6224,7 +6224,7 @@ __metadata:
"@udecode/plate-indent": "npm:38.0.1"
"@udecode/plate-indent-list": "npm:38.0.1"
"@udecode/plate-media": "npm:38.0.6"
"@udecode/plate-table": "npm:38.0.6"
"@udecode/plate-table": "npm:38.0.8"
validator: "npm:^13.12.0"
peerDependencies:
"@udecode/plate-common": ">=38.0.6"
Expand Down Expand Up @@ -6695,7 +6695,7 @@ __metadata:
languageName: unknown
linkType: soft

"@udecode/plate-selection@npm:38.0.0, @udecode/plate-selection@workspace:^, @udecode/plate-selection@workspace:packages/selection":
"@udecode/plate-selection@npm:38.0.9, @udecode/plate-selection@workspace:^, @udecode/plate-selection@workspace:packages/selection":
version: 0.0.0-use.local
resolution: "@udecode/plate-selection@workspace:packages/selection"
dependencies:
Expand Down Expand Up @@ -6764,7 +6764,7 @@ __metadata:
languageName: unknown
linkType: soft

"@udecode/plate-table@npm:38.0.6, @udecode/plate-table@workspace:^, @udecode/plate-table@workspace:packages/table":
"@udecode/plate-table@npm:38.0.8, @udecode/plate-table@workspace:^, @udecode/plate-table@workspace:packages/table":
version: 0.0.0-use.local
resolution: "@udecode/plate-table@workspace:packages/table"
dependencies:
Expand Down Expand Up @@ -6911,9 +6911,9 @@ __metadata:
"@udecode/plate-combobox": "npm:38.0.1"
"@udecode/plate-comments": "npm:38.0.1"
"@udecode/plate-common": "npm:38.0.6"
"@udecode/plate-csv": "npm:38.0.6"
"@udecode/plate-csv": "npm:38.0.8"
"@udecode/plate-diff": "npm:38.0.0"
"@udecode/plate-docx": "npm:38.0.6"
"@udecode/plate-docx": "npm:38.0.8"
"@udecode/plate-find-replace": "npm:38.0.0"
"@udecode/plate-floating": "npm:38.0.1"
"@udecode/plate-font": "npm:38.0.1"
Expand All @@ -6936,11 +6936,11 @@ __metadata:
"@udecode/plate-reset-node": "npm:38.0.1"
"@udecode/plate-resizable": "npm:38.0.0"
"@udecode/plate-select": "npm:38.0.1"
"@udecode/plate-selection": "npm:38.0.0"
"@udecode/plate-selection": "npm:38.0.9"
"@udecode/plate-slash-command": "npm:38.0.1"
"@udecode/plate-suggestion": "npm:38.0.1"
"@udecode/plate-tabbable": "npm:38.0.1"
"@udecode/plate-table": "npm:38.0.6"
"@udecode/plate-table": "npm:38.0.8"
"@udecode/plate-toggle": "npm:38.0.1"
"@udecode/plate-trailing-block": "npm:38.0.1"
peerDependencies:
Expand Down

0 comments on commit 3b22f82

Please sign in to comment.