Event OnDeactivated is not called last

So I have an UI for filtering, it has an editable text box and is an activatable widget.

The issue I have is when the user presses ESC to leave the filter widget, then OnDeactivated is called first and the text committed is called last!

This prevents me from efficiently triggering an update event when the widget is deactivated. As a workaround I have set a boolean for controlling this but i’m fully aware that the event will then be called twice. Is there any better solution?