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
feat: introduce event.target element to DOM event #11992
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me, but I'll leave it up to @mstahv to decide when this would be taken in.
one test is failing:
|
Looks like a needed feature to me, I think I would have needed this when doing one add-on in the past as well. Check if we have a natural place to discuss about this enhancement in our docs. My guess is not, and if so, let's just leave it with JavaDocs only. There is also other low level DOM API that is only covered in JavaDocs. |
I really like the addition; just one question - what do you think about renaming |
Makes is possible to obtain the Element instance on the server side that corresponds to `event.target` for a DOM event. The mapping needs to be explicitly enabled with DomListenerRegistration.mapEventTargetElement() for it to work. Next steps would be to introduce an API to certain component events that leverage the API, or generalizing the API so that one could give out an JS string that would be mapped instead of `event.target`. Closes #3356
None of the existing API in the class follow this pattern e.g. |
SonarQube analysis reported 2 issues
|
The bot is mistaken as the added interface method has a default implementation and is not thus a breaking change. |
This ticket/PR has been released with platform 22.0.0.alpha8 and is also targeting the upcoming stable 22.0.0 version. |
Makes it possible to use event data expressions that map to any Component / Element from server side state tree. For example it will be possible to use: - `@EventData("event.target") Component eventTarget` for `@DomEvent` - `@EventData("event.target") Element eventTarget` for `@DomEvent` - `DomEventRegistration::addEventDataElement(String expression)` to get any element mapped, - and fetch it with `DomEvent::getEventDataElement(String expression) Follow up for #11992, #3356
Makes it possible to use event data expressions that map to any Component / Element from server side state tree. For example it will be possible to use: - `@EventData("event.target") Component eventTarget` for `@DomEvent` - `@EventData("event.target") Element eventTarget` for `@DomEvent` - `DomEventRegistration::addEventDataElement(String expression)` to get any element mapped, - and fetch it with `DomEvent::getEventDataElement(String expression) Follow up for #11992, #3356
Makes is possible to obtain the Element instance on the server side that corresponds to `event.target` for a DOM event. The mapping needs to be explicitly enabled with DomListenerRegistration.mapEventTargetElement() for it to work. Next steps would be to introduce an API to certain component events that leverage the API, or generalizing the API so that one could give out an JS string that would be mapped instead of `event.target`. Closes #3356
Makes it possible to use event data expressions that map to any Component / Element from server side state tree. For example it will be possible to use: - `@EventData("event.target") Component eventTarget` for `@DomEvent` - `@EventData("event.target") Element eventTarget` for `@DomEvent` - `DomEventRegistration::addEventDataElement(String expression)` to get any element mapped, - and fetch it with `DomEvent::getEventDataElement(String expression) Follow up for #11992, #3356
Makes is possible to obtain the Element instance on the server side that corresponds to `event.target` for a DOM event. The mapping needs to be explicitly enabled with DomListenerRegistration.mapEventTargetElement() for it to work. Next steps would be to introduce an API to certain component events that leverage the API, or generalizing the API so that one could give out an JS string that would be mapped instead of `event.target`. Closes #3356
Makes it possible to use event data expressions that map to any Component / Element from server side state tree. For example it will be possible to use: - `@EventData("event.target") Component eventTarget` for `@DomEvent` - `@EventData("event.target") Element eventTarget` for `@DomEvent` - `DomEventRegistration::addEventDataElement(String expression)` to get any element mapped, - and fetch it with `DomEvent::getEventDataElement(String expression) Follow up for #11992, #3356
Makes is possible to obtain the Element instance on the server side that corresponds to `event.target` for a DOM event. The mapping needs to be explicitly enabled with DomListenerRegistration.mapEventTargetElement() for it to work. Next steps would be to introduce an API to certain component events that leverage the API, or generalizing the API so that one could give out an JS string that would be mapped instead of `event.target`. Closes #3356
Makes it possible to use event data expressions that map to any Component / Element from server side state tree. For example it will be possible to use: - `@EventData("event.target") Component eventTarget` for `@DomEvent` - `@EventData("event.target") Element eventTarget` for `@DomEvent` - `DomEventRegistration::addEventDataElement(String expression)` to get any element mapped, - and fetch it with `DomEvent::getEventDataElement(String expression) Follow up for #11992, #3356
This ticket/PR has been released with Vaadin 14.9.0.alpha1 and is also targeting the upcoming stable 14.9.0 version. |
Makes it possible to obtain the Element instance on the server side
that corresponds to
event.target
for a DOM event. The mapping needsto be explicitly enabled with DomListenerRegistration.mapEventTargetElement()
for it to work.
Next steps would be to introduce an API to certain component events that
leverage the API, or generalizing the API so that one could give out an
JS string that would be mapped instead of
event.target
.Closes #3356