Last comment not available in event handler


Similar to this issue, the true last comment is not accessible in the comments array ( {{_.last(chatComponent.comments).value}} ) on submit using an event handler. As stated in the issue mentioned, it seems that the last comment is posted after the event handlers have run. A solution or workaround was never given.

I have tried a bunch of things to get around this, such as setting temporary state or adding some sort of delay in one of the event handlers but nothing has seemed to work.

I need to send the comment submitted to my api


Hi @rfree!

I may have found a workaround for now :slight_smile:

It seems like adding a debounce time to the event handler of at least 28 (milliseconds) solves the problem.

Would something like this work for you?