Caret position lost after pasting text to input field

Hello @jdtokyo
I’m with you on this (the need to have a public method to set caret position).
I remember that I had some issues for my Chat Project (Online chat 100% based on BJS GUI)


Having a look back to my code, I get to this :

// Goal is to put Input Caret at the end (only private)
// https://forum.babylonjs.com/t/set-input-caret-position/32778/3
function triggerArrowDown() {
    let evt = new KeyboardEvent('keydown', {
        key: 'ArrowDown',
        code: 'ArrowDown',
        keyCode: 40,
        which: 40,
        bubbles: true,
        cancelable: true,
        view: window
    });
    canvas.dispatchEvent(evt);
}

Funny enough, the comment even contains a topic of this forum that I had in mind to come back to :