Install TextMeshPro package from the package manager, it has a built in input field that supports scrolling out of the box without any coding.

It is also the future of unity's text.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence