When syntax for a list of targets is entered, the script listens for a closing bracket "]", and a special keydown handler closes the bracket group and removes the trailing "," delimiter that was automatically output. This keydown listener needs to stop listen after a bracket group is already closed. But it looks like a subsequent "]" typed in the message body is triggering this handler and removing a few of the user's typed message characters with it.
When syntax for a list of targets is entered, the script listens for a closing bracket "]", and a special keydown handler closes the bracket group and removes the trailing "," delimiter that was automatically output. This keydown listener needs to stop listen after a bracket group is already closed. But it looks like a subsequent "]" typed in the message body is triggering this handler and removing a few of the user's typed message characters with it.