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

Table crashes when combined with CharacterCount #1550

Closed
mark-lumbao opened this issue Jul 7, 2021 · 3 comments · Fixed by #2256
Closed

Table crashes when combined with CharacterCount #1550

mark-lumbao opened this issue Jul 7, 2021 · 3 comments · Fixed by #2256
Labels
Type: Bug The issue or pullrequest is related to a bug

Comments

@mark-lumbao
Copy link

mark-lumbao commented Jul 7, 2021

Description
The app crashes as soon as the set limit for character count is reached. But this behavior only happens when Table is used with CharacterCount.

Steps to reproduce the bug
Steps to reproduce the behavior:

  1. Clone my test repo https://github.com/mark-lumbao/react-rich-text-editor
  2. Install dependencies then run npm run start:dev
  3. Open the app in the browser
  4. Insert a table then continue adding table content till the limit is reached

Github Repo
I created a Github repo to help you debug the issue:

Expected behavior
As seen in the attached video, the app crashes when the limit is reached.

Screenshot, video, or GIF

tiptapdemo-2021-07-07_21.20.33.mp4

Environment?

  • operating system: Linux Manjaro
  • browser: Brave Browser
  • mobile/desktop: Desktop
  • tiptap version: 2 beta
@mark-lumbao mark-lumbao added Type: Bug The issue or pullrequest is related to a bug v2 labels Jul 7, 2021
@yellow1912
Copy link

There is another issue with ChracterCount, the size of this inclusion is huge for whatever reason. I remember I saw a related issue but I cannot find it anywhere.

image

@hanspagel
Copy link
Contributor

@yellow1912 All packages include the core, the typical development setup (webpack, rollup …) will make sure to include the code only once. That’s called tree-shaking. You need to look at your bundle size, not the individual package size.

@mark-lumbao
Copy link
Author

I added a temporary fix in my repo. I disabled the character limit when paired with tables for now. I'd still check here for updates if ever a proper fix is suggested though. Thanks!

@hanspagel hanspagel removed the v2 label Sep 28, 2021
philippkuehn added a commit that referenced this issue Dec 8, 2021
…#1049, fix #1550, fix #1839, fix #2245

* fix a bug when exceeding the character limit

* find a better way to limit the doc size

* check paste events

* add storage method

* refactoring

* use textBetween instead of textContent

* return early if no limit is set

* add words method to storage

* show word count in charactercount demo

Co-authored-by: Philipp Kühn <[email protected]>
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

Successfully merging a pull request may close this issue.

3 participants