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

Event Bubbling #2

Closed
ShaMan123 opened this issue Dec 24, 2020 · 5 comments
Closed

Event Bubbling #2

ShaMan123 opened this issue Dec 24, 2020 · 5 comments

Comments

@ShaMan123
Copy link
Contributor

I had to use MathField.setOptions to register events because the react event system doesn't work well with shadow nodes.
issue

@ShaMan123 ShaMan123 changed the title Event Registration Event Bubbling Dec 24, 2020
@ShaMan123
Copy link
Contributor Author

This causes another strange bug.
If the mathfield doesn't have some callback option set none are fired.

@ShaMan123
Copy link
Contributor Author

ShaMan123 commented Dec 24, 2020

I had to use MathField.setOptions to register events because the react event system doesn't work well with shadow nodes.
issue

The behavior of addEventListener is rather unexpected
In some case they all fire only on blur (except key input event), as if they are queueing.

Related:
https://stackoverflow.com/questions/23892547/what-is-the-best-way-to-trigger-onchange-event-in-react-js#46012210
facebook/react#11488
https://stackoverflow.com/a/62111884/9068029

@ShaMan123
Copy link
Contributor Author

ShaMan123 commented Dec 24, 2020

I had to use MathField.setOptions to register events because the react event system doesn't work well with shadow nodes.
issue

This has surfaced another bug. Some of the callbacks registered direclty via setOptions don't fire.
And the strangest thing is that if I pass more options it seems to work.
Hard to saw where this resides...
React? MathLive? This impl?

@ShaMan123
Copy link
Contributor Author

ShaMan123 added a commit to ShaMan123/react-mathlive that referenced this issue Dec 25, 2020
Was using wrong names 😧 My bad.
Deprecated all hacks.
Seems stable
fixs arnog#2 arnog#3
@ShaMan123
Copy link
Contributor Author

This was all me.

I confused event names and used wrong ones.
I saw in source code that bubbling is handled correctly.
closes #3

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