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

Are you aware of that method .on doesn't work properly? #2620

Closed
KamGor opened this issue Feb 16, 2024 · 7 comments
Closed

Are you aware of that method .on doesn't work properly? #2620

KamGor opened this issue Feb 16, 2024 · 7 comments

Comments

@KamGor
Copy link

KamGor commented Feb 16, 2024

Method .on doesn't register listener on events. More of it you don't added anywhere events list.

Expected behavior: Change of model should fire change event or something else but it doesn't work.

Editor.js version: 2.29.0

@KamGor KamGor added the bug label Feb 16, 2024
@KamGor KamGor changed the title Do you aware of that method .on doesn't work properly? Are you aware of that method .on doesn't work properly? Feb 16, 2024
@keremnymn
Copy link

Same issue, editor won't register any event:

        instance.isReady.then(() => {
            setEditorInstance(instance);
            instance.on("click", (e) => {
                console.log(e) // never triggered
            })
        });

@neSpecc neSpecc removed the bug label Feb 28, 2024
@neSpecc
Copy link
Member

neSpecc commented Feb 28, 2024

Editor is not an Event Target at the moment. Where did you found such a code like instance.on()? Our docs says nothing about it.

But currently we're thinking about exposing our Event Bus to the API. Probably it will be added in 2.30

@neSpecc neSpecc closed this as completed Feb 28, 2024
@KamGor
Copy link
Author

KamGor commented Feb 29, 2024

@neSpecc I think it's not clearly stated as you tell. In documentation there is Core API/Listeners chapter where are misguiding information. I have added PR #2621 where is described proper events names.

@neSpecc
Copy link
Member

neSpecc commented Feb 29, 2024

Actually the Listeners module is just a utility for binding/clearing events. It's not a public Event Bus and you won't see any editor events in there

@keremnymn
Copy link

I inferred from this line

@neSpecc
Copy link
Member

neSpecc commented Feb 29, 2024

I have added PR #2621 where is described proper events names.

Now I see. You're talking about Events API, not a Listeners. It's a relatively new api and we have no documentation for it. Would you add that docs to the https://github.com/codex-team/editorjs.io instead of docs/usage.md?

@KamGor
Copy link
Author

KamGor commented Feb 29, 2024

Yes, I will. Thank you!

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