如何在 Blazor 中的 TextArea 的值每次发生变化时自动滚动到底部?
为了测试它,我尝试使用内联 JS 来更改我在 Stack Overflow 上找到的元素的大小:“ oninput="this.style.height = 'auto'; this.style.height = (this.scrollHeight) + 'px';" "
只要我手动填充文本区域,它就可以工作。但当像我想的那样从后端填充它时它不起作用:
protected async System.Threading.Tasks.Task TestButtonClick0()
{
TextAreaText += ">> SPAM Test \n";
}
Run Code Online (Sandbox Code Playgroud)