Fix character counter for the WYSIWYG editor#9680
Fix character counter for the WYSIWYG editor#9680andreslucena merged 3 commits intodecidim:developfrom
Conversation
Crashillo
left a comment
There was a problem hiding this comment.
Since we've in mind the jQuery deprecation, it would be useful to replace some basic functions with vanilla js. A gradual migration.
|
@ahukkanen it's probably something related with my assets, but I tried rebuilding them and still see the same: while adding characters, the Can you check this out to confirm if you see this same behavior, please? I can reproduce it on Firefox and Chrome. It seems like if a focus out of the window, the NaN changes to the correct count. wordcounter-nan.mp4 |
|
@andreslucena No, it was actually a bug in the character counter. Not related to this PR but anyways a bug. It's fixed now. While checking that I also noticed that the WYSIWYG editor allows more characters than the maximum amount of characters defined for the body text which causes the character counter to go to negative values. But this is another issue that should be addressed separately from this PR. |
This "while checking that bug I found another bug" remind me of this classic short video 😅 I agree, let's split it on multiple PRs, so we can move forward with this one. |
andreslucena
left a comment
There was a problem hiding this comment.
Tried it out locally and work as expected. It also fixed the screen reader bug. Two for the price of one!! 😄
* develop: (24 commits) Add develop index to the documentation (#9666) Fix initiatives components (#9633) Fix conference speaker avatars (#9643) Update `rokroskar/workflow-run-cleanup-action` GitHub action to v0.3.3 (#9750) Fix character counter for the WYSIWYG editor (#9680) Fix posting comments before the initial load has run (#9614) Fix parallel tests port in use (#9661) Split parallel test coverage reports into their own folders (#9686) Improve admin panel user experience regarding title links and order of actions (#9496) Fix title and description too long in initiatives spec sometimes (#9648) Fix API GraphiQL system spec with newer ChromeDriver (#9642) Add missing character on code block (#9798) Fix hidden error messages on the registration form (#9625) Add documentation about configuring ActiveStorage / dynamic file uploads (#9777) Add documentation section about customizing cells (#9622) Fix hashtags not recognized at the beginning of the string (#9616) Fix version pages showing a HTTP 500 error when the version does not exist (#9615) Fix multitenant organizations stats cache (#9605) Prevent the account edit route through Devise (#9611) Fix iframe disabling producing invalid HTML (#9685) ...
|
@ahukkanen do you also plan to backport this feature in 0.26? |
|
@paulinebessoles Probably not because we have changed the character counter in 0.27, so this cannot be directly backported to 0.26. It would have to be re-implemented for 0.26. |
* Fix character counter for the WYSIWYG editor * Fix announce threshold calculation bug reported in the review
🎩 What? Why?
The character counter is currently broken for the WYSIWYG editor I believe after the screen reader updates at #9009.
This makes the character counter work again with the WYSIWYG editor.
📌 Related Issues
Testing
Note that the "empty" field character counting is a bit buggy in Quill.js (which is the rich text editor). It automatically injects one paragraph to the text with a line break in it, so I believe it is because of this reason why it calculates the "empty" input as 2 characters.