TMP Input Field inside Scroll Rect: How to follow the caret?

I have an Input Field from TextMesh-Pro inside of a Scroll View. This Input Field has a Content Size Fitter to make the scrollbars change size when typing.
I am now looking for a way to move the scrollbars so that the caret is always inside of the viewport (in other ways, allow the user to always see what he is typing).

I didn’t find a way to do this automatically so I started writing a script to do it. The only problem is that I can’t find a way to get the caret’s world or screen position, only it’s index in the string.

How could I do this?

If you need scrollable input field you can achieve this by using TMP InputField control, without Unity’s scroll rect. Just import text mesh pro examples and find one called “scrollable input text” or something like that, i think it was example 24 not sure.

Like @JaksaGR mentioned, you can go into the example scene loaded from TMP Samples and Examples. Except the scene was 20 - Input Field with Scrollbar. It has two examples, which were both very helpful.

Thanks JaksaGR!