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

Is there any event triggered on text input? #24

Open
konclave opened this issue Mar 21, 2016 · 2 comments
Open

Is there any event triggered on text input? #24

konclave opened this issue Mar 21, 2016 · 2 comments

Comments

@konclave
Copy link

The only way I've found to listen to the text input is to add event listener to woofmark.find(textarea).textarea and .editable objects.
Is there any other way of doing that?

@septagram
Copy link

Also it would be really great to trigger an event upon switching between modes. An example usage would be making the textarea autoexpand, which currently requires not only watching for new input inside the textarea, but also somehow detecting the switch away from the WYSIWYG mode, because that also means the text in the textarea might have changed.

@jywarren
Copy link
Collaborator

jywarren commented Jun 6, 2016

The library uses crossvent, an event library also by @bevacqua -- so you can create events using crossvent like this: https://github.com/publiclab/PublicLab.Editor/blob/12287656c35630a77c47a547f87e12d70c89a585/src/modules/PublicLab.RichTextModule.js#L135-L149

However, I'm not sure what all the different events are, and it's still element-based, so I think you may still need to watch both elements. But the above example triggers on mode change.

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

3 participants