soccerloway/quill-better-table

Cannot read properties of undefined (reading 'pop')

LeeQe opened this issue · 5 comments

LeeQe commented

Cannot read properties of undefined (reading 'pop')
TypeError: Cannot read properties of undefined (reading 'pop')
at new quill_better_table_BetterTable (webpack-internal:///./node_modules/quill-better-table/dist/quill-better-table.js:3067:66)
微信截图_20230802174942

atul60 commented

I am also getting exactly the same problem. Please provide a solution.

I have the same error
In that line need to change bindings like this

    let thisBinding = quill.keyboard.bindings['8'].pop()
    quill.keyboard.bindings['8'].splice(0, 1, thisBinding)

Because Quill normalizes the key name and instead of Backspace it makes it the actual key code: 8

I have the same error In that line need to change bindings like this

    let thisBinding = quill.keyboard.bindings['8'].pop()
    quill.keyboard.bindings['8'].splice(0, 1, thisBinding)

Because Quill normalizes the key name and instead of Backspace it makes it the actual key code: 8

you save me!

++ add the route
node_modules > quill-better-table > dist > quill-better-table.js
At first I tried to change the code at quill-better-table.js in src and It doesn't work.
NOT src folder YES dist folder

export const modules = {
table: false,
"better-table": {
operationMenu: {
items: {
unmergeCells: {
text: "Another unmerge cells name",
},
},
},
},
keyboard: {
bindings: quillBetterTable.keyboardBinding["8"].splice(
0,
1,
quillBetterTable.keyboardBinding["8"].pop()
),
},
toolbar: [
["bold", "italic", "underline"],
[{ header: [1, 2, 3, 4, 5, 6, false] }],
[{ list: "ordered" }, { list: "bullet" }],
[{ color: [] }, { background: [] }],
[{ size: ["normal", "small", "large", "huge"] }, "size"],
[{ indent: "-1" }, { indent: "+1" }],
[{ font: [] }],
[{ align: [] }],
["image"],
["pageBreak"],
["sceneBreak"],
],

imageUploader: {
upload: (file) => {
return new Promise((resolve, reject) => {
const params = {
Bucket: "simplymemoirs",
Key: images/${file.name},
Body: file,
ACL: "public-read",
};
s3.upload(params, (err, data) => {
if (err) {
console.error(err);
reject(err);
} else {
console.log(File uploaded successfully. URL: ${data.Location});
resolve(data.Location);
}
});
});
},
},
clipboard: {
// toggle to add extra line breaks when pasting HTML:
matchVisual: false,
},
imageResize: {
parchment: Quill.import("parchment"),
modules: ["Resize", "DisplaySize", "Toolbar"],
handleStyles: {
display: "block",
marginLeft: "auto",
marginRight: "auto",
cursor: "pointer",
},
},
cardEditable: true,
};
How to use in react????
Cannot read properties of undefined (reading '8')