-
Notifications
You must be signed in to change notification settings - Fork 130
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
Make all events go through the DOM #239
Conversation
7c8d409
to
bc10ed8
Compare
@mxmason I would love your opinion on this. :) |
I think this is a good idea, and I'd be in favor of implementing it in our TypeScript file. I think we can keep |
Agreed. Re-reading that PR the other day, I also thought we should keep the |
So. While researching this a bit, I discovered that the |
Interesting. What do you think? |
After thinking about it, I’d like to propose that we drop IE11 with version 8 and point authors to 7.x if they need IE support. |
I‘m happy with that decision. I think it’s also moving the needle forward. All good with me. |
Sweet. I'll get to work pulling out the build tooling we no longer need :) |
Yay! Thank you. 😊 |
bc10ed8
to
e5cbc88
Compare
e5cbc88
to
fb6ea94
Compare
@mxmason Hiii! ✨ I rebased that PR but have a TypeScript issue I don’t understand. Any clue? 😅 |
Oh, I think it’s because we can use the |
Ah, you got it! I think this looks good to ship if you're ready! Edit to add: Should our custom events be |
@KittyGiraudel friendly ping :) |
@chalkygames123 Why? |
Because @mxmason added some questions in the last comment. Sorry if I missed something or if this has already been resolved in a private discussion 😅 |
Oh, I actually totally missed that edit from EJ. Thank you for pinging me!
I would say yes. Probably best to be flexible? I’ll issue a commit to deal with that. Edit: 1c15741.
I think this is important to know which DOM node triggered the open/close of the dialog. Without the event, we can’t I’m afraid? |
This is a proof of concept that would make all events go through the DOM under the hood. This would mean they would no longer be attached to the dialog instance itself, but on the dialog DOM container instead. This just reduces the amount of code shipped (not by a lot though).
The way this is implemented would likely cause no API breaking change.The object passed to the events would now be aCustomEvent
, and accessing the underlying DOM node would require readingevent.detail.currentTarget
instead ofevent.currentTarget
, so this is a breaking change.We could also decide to drop
.on
and.off
methods entirely, but it might be good to keep them for convenience. Otherwise the API would be a little awkward (having to read the element from the instance to bind listeners).