Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

hotfix: empty editor and required field fix when onChange event is triggered #59

Conversation

TunahanTuna
Copy link
Contributor

onChange event was not triggering when the editor was empty.

To solve this problem I changed the newData.blocks.length condition to !newData.blocks.length

If condition is met, newData is made null.

I returned the newData unchanged in cases where this condition is not met.

So now we can trigger the onChange event when the editor is empty.

The newData = null statement can also provide control when text input is required.

@melishev melishev merged commit 6320c2a into melishev:master Sep 2, 2022
github-actions bot pushed a commit that referenced this pull request Sep 2, 2022
## [2.0.2](v2.0.1...v2.0.2) (2022-09-02)

### Bug Fixes

* empty editor and required field ([#59](#59)) ([6320c2a](6320c2a))
@melishev
Copy link
Owner

melishev commented Sep 2, 2022

🎉 This PR is included in version 2.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants