Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[An error occurred when table toggle orderedList]The first row of a cell in the table cannot be executed toggleOrderedList or toggleBulletList #2279

Closed
1 of 2 tasks
yinran100 opened this issue Dec 15, 2021 · 0 comments
Labels
Type: Bug The issue or pullrequest is related to a bug

Comments

@yinran100
Copy link

What’s the bug you are facing?

image

Uncaught RangeError: Index 1 out of range for <table(tableRow(tableHeader(orderedList(listItem(paragraph("cccs"))), paragraph("sczffsef")), tableHeader(paragraph), tableHeader(paragraph), tableHeader(paragraph), tableHeader(paragraph)), tableRow(tableCell(paragraph), tableCell(paragraph), tableCell(paragraph), tableCell(paragraph), tableCell(paragraph)), tableRow(tableCell(paragraph), tableCell(paragraph), tableCell(paragraph), tableCell(paragraph), tableCell(paragraph)), tableRow(tableCell(paragraph), tableCell(paragraph), tableCell(paragraph), tableCell(paragraph), tableCell(paragraph)))>
at Fragment2.child (fragment.js:159)
at Fragment2.findIndex (fragment.js:205)
at Node2.nodeAt (node.js:189)
at joinListBackwards (toggleList.ts:17)
at toggleList.ts:114
at command.ts:15
at Object.chainedCommand [as command] (CommandManager.ts:92)
at toggleList.ts:114
at Object.toggleList (CommandManager.ts:149)
at ordered-list.ts:69

How can we reproduce the bug on our side?

<button onClick={() => editor.chain().focus().toggleBulletList().run()} className={show-button ${editor.isActive('bulletList') ? 'act' : ''}} > <IconFont className="icon " type='num_less'/> </button>
After the second row, it's ok

Can you provide a CodeSandbox?

CodeSandbox :https://codesandbox.io/s/nostalgic-surf-x0mzj?file=/src/App.js

What did you expect to happen?

  1. select a tablecell

  2. click toggleOrderedList

Anything to add? (optional)

No response

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@yinran100 yinran100 added the Type: Bug The issue or pullrequest is related to a bug label Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug The issue or pullrequest is related to a bug
Projects
None yet
Development

No branches or pull requests

1 participant