-
Notifications
You must be signed in to change notification settings - Fork 420
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
Ensure firing out event #391
Conversation
This does not affect bpmn-io/bpmn-js#1123 (despite the fact this bug may also be caused by a missing fired event) |
78bf231
to
e010ee5
Compare
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.
This fix is substantially different from the HoverFix
:
- it emits a fake element.out event
- it hooks into low-level DOM events to get the job done
The hover fix on the other hand gets along with:
- Using already exposed events
- Faking a
dragging.hover
event, if non existed
Is there a reason why we're going for a different route for the out fix?
Is there a good reason why we don't combine the two into a single file? I guess using only one of them makes no sense, or does it?
+1 going for executing
This aims to ensure the additional out event is NOT thrown when it was already caught. But yeah true, I'd go for tracking the
I think there is not. I wanted to definitely separate the two fixes since they solve different things. Will go for having them in the same module but separate them there instead. |
Why do you expect an additional out event after hover was fired? And if it was thrown, would it hurt? |
Not after the hover, but we have the following happy path in terms of events when we hover from one element to another:
The bug in camunda/camunda-modeler#1383 is caused by the fact the Why so (and does it hurt us if we have multiple out events)? Without the check, we run into side effects which look like bpmn-io/bpmn-js#1123, but it is happening all the time after adding a connection between two elements (as shown in the screencast). We discussed it with @philippfromme yesterday to add the check to ensure, we will not run into this kind of side effects when triggering unnecessary out operations. I'll update the PR to the things mentioned above |
Cool. Thanks for the clarification. |
One additional finding
I tried to go for the In fact, waiting for the next
@nikku what do you think? I'd personally go for the first one. Benefit: not using expensive operations in additional places ... |
e010ee5
to
68ecfef
Compare
Updated the PR to my preferred version. |
I'll need to look into the issue. If you have specific requirements regarding the event order, does it make sense to bake these into the test cases? Right now the coverage you provided is very light. I'd assume we verify the actual order and occurrence of events, from hover to out:
|
Would totally go for additional test coverage, also for the existing Really like the idea of testing the event order, since this would really ensure the expected behavior. Feel free to add additional thoughts regarding the solutions provided above if you had a deeper look. We can also chat about it next week. |
I'm unsure about whether the things you've mentioned are issues I overlook or whether I came up with a solution that just works. Could you checkout 87f2b21 and see if it suffers from the same limitations you mentioned? Please add additional test coverage, regardless of the implementation we are going for. It should not depend on it, anyway. Hint: Do not do |
The problem I described does not come out of your implementation because it just solved them 👍 Great approach! It ensures the things I mentioned (cf. To complete this PR I will
Thanks for your time! |
b8ca804
to
bd06ae1
Compare
Ready to review now! After finishing, I was not able to reproduce bpmn-io/bpmn-js#1123 again. Could be just luck or we really tackled this problem here as well. We will have to double-check it then. Also tried to improve the existing test in |
3852203
to
6593346
Compare
6593346
to
b94a412
Compare
This ensures we definitely fire an
element.out
event between twohover
for different elements. This way we make sure cursor and marker cleanup really got to run, despite the fact some browsers swallow certainmouseout
events.Related to camunda/camunda-modeler#1383