ui icon indicating copy to clipboard operation
ui copied to clipboard

Add "autoResize"/"manualRender" options on ScrollBox

Open RemiCELLARD opened this issue 5 months ago • 0 comments

Please Describe The Problem To Be Solved

For my application, I'm adding several hundred elements to Containers. Each of these Containers represents a line displayed in the ScrollBox component.

Problem: As soon as I add a Container via ScrollBox.addItem (or all with ScrollBox.addItems), it takes a long time to render (~50s on my machine).

(Optional): Suggest A Solution

  • Add an “autoResize”/“manualRender” option to render whenever you like + add ScrollBox.render() method to launch the render manually.
  • Run a single rendering (= 1 call to this.resize() ) when calling the ScrollBox.addItems method (or ScrollBox.addItem with multiple parameters).

Because when you add an item (with ScrollBox.addItem, see this line), it launches a rendering (it's ok). But, if you add multiple items in one method call (with ScrollBox.addItems), each item run a render (=> each items added = 1 call to this.resize()).

RemiCELLARD avatar Sep 25 '24 10:09 RemiCELLARD