Hello Sytze,
I created a test project and was able to recreate your issue. I solved it using the following JavaScript (with jQuery) snippet:
$(".container-msginput").keypress(function(event){
var key = (event.keyCode ? event.keyCode : event.which);
if(key == '13'){
var temp = document.createElement("input");
document.body.appendChild(temp);
temp.focus();
document.body.removeChild(temp);
$(".btn-sendmessage").click();
$(".input-message")[0].firstChild.focus();
}
});
I tried to use the blur() method, then refocusing using the focus() method, yet this did not work for me.
I solved the issue by creating a temp input field to which I change the focus, then removing the temp input field, followed by the execution of the microflow using the click() method, lastly refocusing the initial text message field.
I hope that this helps! :-)
*Edit* Grammar corrections.
Hello Sytze,
Microflows use the view object as an input, which gets held in your cache. I would have expected your object to be updated per key type (with the onchange event) but this doesn't seem the case and the entity appears to be updated on an focusout event.
If you need to be able to hit enter and trigger the behaviour immediately you can try ticking your "Abort on Validation errors" option in your button's microflow settings - this might force an update from the attribute fields. You can also try a field required validation on the field and see if it makes a difference.
The only other alternative I can see is creating your own field or button through either your own custom widget or added through the HTMLSnippet widget.