TMP Input field On Focus - Select All & Scrollbar weird behaviour

Hello,

I’m pretty new to Unity, but I have spent few evenings now trying to solve this issue searching trough internet without success… This disturbs me and I would like to understand what I’m doing wrong.

My issue is regarding TMP Input field & scrollbar behavior. I have TMP Input field which purpose is just to show instructions for the user, so I have ticked the “Read Only”-box in inspector under the Control Settings. I have also ticked “OnFocus - Select All”-box for user to be able to select & copy all the text once. With this setup while on play mode, if I first click the text and select all the text, and after this I click somewhere between the text lines in order to unselect the text, and after text is unselected, I try to scroll down with mouse roll (or dragging by scrollbar handle), the text jumps back to up all the time & I’m never able to reach the bottom of text lines. I’m able to reproduce this behavior also in TMP Examples & Extras Scene 20 (Input Field with Scrollbar) just ticking “Read Only” and “OnFocus - Select All” boxes.

What is causing this weird behavior?

Rgds, Cmike

Since I made recent changes to the scrollbar handling, please make sure you test using the latest release of the TMP package which are:

Version 1.5.3 for Unity 2018.4
Version 2.1.3 for Unity 2019.4
Version 3.0.3 for Unity 2020.x or newer.

Let me know if the behavior persists in these latest release.

Hi, I made an experiment and created new project using version 2019.4.13f1 and installed TMP 2.1.3. I tested with the Example Scene 20 (Input Field with Scrollbar). Ticked OnFocus & Read Only boxes. In play mode, clicked the text (selects all text), then clicking between the text lines to unselect. After this, strange behavior continues and text is jumping up when I try to scroll down.

6562723--743605--upload_2020-11-26_15-24-47.png

6562723--743602--upload_2020-11-26_15-24-4.png

Thanks for the additional information. I’ll take a look as soon as possible.

I also made a short video of problem, it’s available here: https://1drv.ms/v/s!Api0luy0ydTnkBDMf7BUqnzh-2qj?e=P2UuIQ

As previously mentioned, using version 2019.4.13f1 and installed TMP 2.1.3.

Finally had a chance to take a closer look at this and believe have resolved the issue.

Please make the following changes and let me know if this works better now.

6613933--752857--upload_2020-12-11_16-56-14.png

The above should resolve the Read Only scrolling behavior.

1 Like

I made the changes and it works like a dream so far! :slight_smile: Thank you very much Stephan!

1 Like

I have the same problem. Will this be fixed in an upcoming release of TMP?

Yes.

In the meantime, the code changes posted above will enable you to resolve that issue until the new release is available.