-
Notifications
You must be signed in to change notification settings - Fork 39
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
add RichTextCharacterLimit
component
#133
add RichTextCharacterLimit
component
#133
Conversation
RichTextCharacterLimit
component
RichTextCharacterLimit
componentRichTextCharacterLimit
component
I wasn't sure if some default styling for |
@darrenjacoby Yeah honestly that is the main thing I am currently still thinking about. Ideally, the element should be absolutely positioned/floating in the corner of the I'm wondering whether we can apply some magic js based positioning to it since I don't want to introduce a wrapper element that would change the editors markup compared to the frontend. |
Maybe we can use https://floating-ui.com/ to get the element so float in the corner when the block is selected. We can get the selection state info via the const { clientId } = useBlockEditContext(); |
Sounds good, I'll see what we can do based on that recommendation! |
I'm going to merge this onto a new branch in this repo so I can also add to it from there 👍 |
0a9a976
into
10up:feature/add-character-limit-rich-text-component
Description of the Change
Extend
RichText
withRichTextCharacterLimit
in order to enable character limits on rich text content.How to test the Change
Attribute
title
should never exceed the character limit unlessenforce
is set tofalse
. Ifenforce
is set tofalse
, the author will be able to exceed the character limit. Both instances will show a character counter below theRichText
component.Credits
Props @fabiankaegy
Related
#131
@fabiankaegy should we favour a component versus a hook? The implementation and DX feels cleaner.
Checklist:
Please let me know if I can add tests.