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

[Bug]: setContent does not overwrite content when the character limit is smaller than the content size #5902

Open
1 task done
gethari opened this issue Dec 2, 2024 · 0 comments

Comments

@gethari
Copy link
Contributor

gethari commented Dec 2, 2024

Bug Report

Affected Packages

  • Editor Core

Version(s)

  • 2.0.0 (please update with the actual version)

Bug Description

When using the setContent method, the content is not updated if the defined character limit is smaller than the current content size. For example:

  • Content size: 321 characters
  • Limit: 300 characters

In this case, the setContent method does not override the content. Previously, it seemed to reset the content without respecting the limit, but after introducing changes HERE, this behavior seems to be skipped.

Browser Used

  • Chrome (please specify the browser where the issue was observed)

Code Example URL

CodeSandbox Example

Expected Behavior

The setContent method should properly update the content even when the limit is smaller than the content size. It should respect the character limit by truncating or rejecting excessive content rather than retaining the previous content.

Additional Context

This issue makes it challenging to dynamically enforce character limits or update the content when the limit changes. It appears to be related to recent changes in how transactions are handled.

Dependency Updates

  • Yes, I've updated all my dependencies.
@gethari gethari changed the title Content not over written, if limit is higher than what's allowed in CharacterCount [Bug]: setContent does not overwrite content when the character limit is smaller than the content size Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant