Scrollbar attached to TMP inputfield doesn't work properly

I attached a scrollbar to a TMP inputfield.

Attached scrollbar doesn’t scroll to the bottom when I press enter.
It only scrolls after I input something.

(Despite I’m at the bottom of the textfield, scrollbar’s value is not 1)

How can I fix this?

What version of the TMP package are you using?

Unity version 2020.3.12f1c1
TMP Release 1.0.54 Dec 2016 (I find the version code from user guide pdf)

The same bug is found on TMP 3.0.6 April 2021, Unity 2021.1.22f1c1.

Test with the latest release which is version 3.2.0-pre.1 as I did make changes related to the scrollbar behavior.

Preview releases are not always visible in Package Manager so you may have to manually add / reference the package in the Packages/manifest.json.

Thank you.
I find richtext color tag no longer works.
Does it get a new implenment?

<color=grey><link=c1_2_upcase>1-2 Uppercase

is displayed as:

<color=grey>1-2 Uppercase

I’m afraid it is not fixed.
Its behavior is still strange, and the value / size shown on the right doesn’t look good.

And another thing: When I paste some long text into the field, the scrollbar seems to jump randomly.

Sorry for another question.

I decided to make my own scroll bar out of Unity’s ScrollView.
(My project has some other unique requirements. I think I’d better do it myself.)

My solution is tricky: let the input field expand based on line ascender/descender.

Everything worked fine so far, except:
TMP recognize it as a single page.
How can I disable TMP Inputfield’s default PageUp/PageDown?

@TheArtless

How the Input Field and Scrollbar are setup in the Scene hierarchy is very important. Please make sure that you have this setup like it is in example “20 - Input Field with Scrollbar” that is included in the TMP Examples & Extras.

If you have this setup the same way as that example and thus still experiencing the issue then please submit a bug report with project so we can take a closer look.

@Stephan_B

I run the example in 3.2.0, and I can still see a small gap when I press enter. (And scrollbar.value kept changing)
Usually, this small gap means nothing.
But my project was using scrollbar.value to calculate screen position of text, which leads to mistakes.

@TheArtless

I was able to reproduce the issue with TMP 3.0.6 but it does not occur on TMP 3.2.0-pre.1. Could you please double check that you indeed have TMP 3.2.0-pre.1 package installed and then run example “20 - Input Field with Scrollbar” again?

@jonathan_h
Sorry.
It did work.

1 Like