-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
TypeError: leaf.position is not a function #740
Comments
Can you post a stack trace next time you encounter it? |
I saw the error several times but I'm not able to reproduce it again. |
Are you defining custom leaf blots? The line above makes sure |
Nope, not yet using any custom blots in the current implementation where I encountered this error. Though possible that some of the other issues I filed were root causes for the structure getting messed up. |
For my case, a workaround that seems to be working is calling quill.update() explicitly before calling quill.getBounds() My guess at maybe what is going on is that quill is in the middle of creating the new dom nodes for a updateContents() call made just before, and then getBounds() is being call in the middle of it, resulting in it picking up a non-leaf node via scroll.leaf. |
This is probably fixed with 3b2167f but without reproduction steps I can't be certain. The symptoms look the same though. |
Yup, looks like that did the trick! Thanks |
Reproducible Platforms: Link where tested Steps
WB: Uncaught TypeError: leaf.position is not a function |
I did make sure that i am using 3b2167f on my repository and the bug still occurs. I have a consistent way to reproduce this error:
|
I also experience a similar error, "leaf.position is not a function". Interestingly, it also involves an arrow keypress, but in my case, it's the down arrow. I'm not sure why in some cases I've addressed this in a hack that seems to work for me here: https://github.com/1010data/quill/commit/03f3b6f73840425f0cf61f4983ca3b0ef9b69383 Note that this is based off the 1.3.6 branch. If someone with this issue wants to test, you can use the "quill-leaf-fix" npm package. Note that you'll have to change your quill import/require statements to use 'quill-leaf-fix' instead, or figure out some other clever approach. |
Is this commit 3b2167f merged to the latest version .. is this the solution for this error also: |
Quill 2.0 has been released (announcement post) with many changes and fixes. If this is still an issue please create a new issue after reviewing our updated Contributing guide 🙏 |
I saw the following error several times.
I'll try to reproduce it while writing the deltas in the console.
Steps for Reproduction
Platforms:
Firefox 47 on Windows 7
Version:
1.0-beta.4
The text was updated successfully, but these errors were encountered: