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

Offer a callback for Content changes #343

Open
PJUllrich opened this issue Jul 5, 2024 · 1 comment
Open

Offer a callback for Content changes #343

PJUllrich opened this issue Jul 5, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@PJUllrich
Copy link

Hey there, I'm trying to figure out how I can listen to content changes both in the RichTextView and the MarkdownView so that I can use the rendered HTML and update a form field with it. In other frameworks, you can add a callback when instantiating the editor or you can listen to custom events like data:change. I'm struggling to understand how Stacks-Editor allows users to react to state changes really. Would you mind clarifying this part, please?

@PJUllrich PJUllrich added the enhancement New feature or request label Jul 5, 2024
@giamir
Copy link
Contributor

giamir commented Jul 8, 2024

Currently we don't support that feature out of the box and we cannot guarantee we will implement it any time soon.

If for your use case you need a callback to be executed all the times something changes in the editor I would recommend you to write a simple plugin like this one and pass it as an option when you instantiate the editor (see here).

I will leave this issue open for now since I can see how a more straightforward mechanism to detect user changes in the editor could be useful in various situations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants