Premium support for our pure JavaScript UI components


Post by syl »

Hello,

I'm experiencing an issue with the validation of event drop events, using beforeEventDropFinalize.
The same code that was working in 4.3.x is no longer working with 5.0.2 and 5.0.3.

I can reproduce it as follows:

  • take the validation example: https://bryntum.com/examples/examples-scheduler/validation/
  • replace the content of the beforeEventDropFinalize event handler to always reject asynchronously the drop:
    context.async = true;
    context.finalize(false);
    
  • as a result, the view seems to be broken, the event is not replaced to its orignal place, and no more dragging can be done (but resize still works, as an example).

Of course, my codebase is more complex than that, and is not always rejecting the drop, but this is the minimal example that can reproduce this issue.

Can you have a look and let me know what is wrong with it?
Possibly include a patch in the next release?

Thanks.
Sylvain


Post by mats »

replace the content of the beforeEventDropFinalize event handler to always reject asynchronously the drop:

Looks like you indicate that the drop finalization is async, yet you finalize it immediately...? What's the use case behind?


Post by syl »

Well this is a minimalist example.
The real use case is one where I am running various validations to determine whether to accept the drop or not.
Some validation do not require async calls, while others do.
And I get this "frozen drag" behaviour when the non-async validations reject the drop.
So I have applied a full async strategy for the whole thing


Post by alex.l »

Did you try to switch async back on false before return value, in case you don't need it being async?

All the best,
Alex


Post by syl »

Not until now, but indeed it seems to work that way...
If I understand correctly:

  • for validation code that run sync, then use context.valid = false; return; to reject the drop
  • once async validation code kicks in, then set context.async = true; call context.finalize(false); return;
    Is that correct?
    Wouldn't it be simpler to just assume everything is async in this case?

Do you consider this behaviour as a bug? (as a reminder it was working ok with v4.3.x).


Post by alex.l »

Ok, we just make sure you are not blocked because of that.
It wouldn't be simpler because usually there is no need in async validation and/or using beforeEventDropFinalize, but in that case user will be needed to take care of it.
We will check it deeply, here is a ticket: https://github.com/bryntum/support/issues/4589

All the best,
Alex


Post Reply