-
Notifications
You must be signed in to change notification settings - Fork 167
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:allow explicitly reveiving certain dom events for inert elements #19121
Conversation
There is bit ugly API changes, but luckily only for internal classes (marked properly with documentation). Some code smell, but don't have good ideas how to refactor as I don't understand all the details related to the implementation. |
A comment after a quick and not in-depth look: do we really need to change I apologize in advance if the above statements are incorrect 😁 |
I would follow Marco's suggestion if it works to reduce the possibility of any breaking change 😅 |
The "breaking changes" are only in classes marked with "For internal use only. May be renamed or removed in a future release.", so I think those ought to be rather safe. I spent quite a while looking into a way to get the right details, but I sure might have missed some opportunity due to the complexity of the code. I have an hour or two in car so I can give it an another look now, but my my true wish is that somebody who actaully understands this code would step in :-) @mcollovati is there any kind of "developer docs" for this internals? Like some kind of brief overview or description of what these classes do or even just some class/sequence diagrams? Currently it is very hard to understand how the thing are supposed to work and why it is build in this way... |
Oh yes, the allowInter is an instance method, overriding that might help 👍 |
If we can assume that this piece in AbstractRpcInvocationHandler:
... returns the same instance as |
Refactored, the current state isn't tested in any ways though now... |
There is now a unit test IT will be there throught the resize event improvement. I think this is ready. Annotation support could be added later if needed, I don't need it. |
The node get from UI in |
flow-server/src/main/java/com/vaadin/flow/internal/nodefeature/ElementListenerMap.java
Outdated
Show resolved
Hide resolved
flow-server/src/main/java/com/vaadin/flow/internal/nodefeature/ElementListenerMap.java
Outdated
Show resolved
Hide resolved
...tests/test-root-context/src/main/java/com/vaadin/flow/uitest/ui/BrowserWindowResizeView.java
Outdated
Show resolved
Hide resolved
...tests/test-root-context/src/main/java/com/vaadin/flow/uitest/ui/BrowserWindowResizeView.java
Outdated
Show resolved
Hide resolved
It looks like this change is breaking navigation on modal components ( |
@mstahv if you are busy, I can apply the changes and then continue the discussion |
@mcollovati Go ahead if you have these in IDE already! Otherwise I can open this again at some point when I can't get text out of my brain 😁 |
Probably the whole isNavigationInvocation logic should be in that event specific implementation 🤔 |
I'll spend a minute on this... |
Nah, if you have good ideas @mcollovati, go for it. My idea was to use the new API for those navigation events, but they are some "special cases" and it started to look complicated... |
...ver/src/main/java/com/vaadin/flow/server/communication/rpc/AbstractRpcInvocationHandler.java
Show resolved
Hide resolved
...ver/src/main/java/com/vaadin/flow/server/communication/rpc/AbstractRpcInvocationHandler.java
Show resolved
Hide resolved
Looks good to me! @mcollovati did you have any remaining comments about this one? |
Quality Gate passedIssues Measures |
Looks good to me too. There's still a pending discussion about the message log level, but if we want to differentiate between dev and prod, we can do it in another PR |
Excellent! I migth even be so bold that I would throw illegal state exception, at least in dev mode. |
This ticket/PR has been released with Vaadin 24.4.0. |
Added API to allow bypassing inert check for DOM events.
Fixes #19116
Type of change
Checklist
Additional for
Feature
type of change