Position of thumb in scrollbar is calculated as
def trackPos:Number = bind ((trackLength - thumbLength) * ((bar.value - bar.min) / (bar.max - bar.min)));
But sometimes bar.max == bar.min (e.g. for invisible scrollbar inside textbox where max = min = 0). This leads to division by 0 causing trackPos to be NaN.
This breaks dirty area management in mobile runtime and makes multiline textbox unusable.
Defining track pos as
def trackPos:Number = bind if (bar.max - bar.min > 0) ((trackLength - thumbLength) * ((bar.value - bar.min) / (bar.max - bar.min))) else 0
fixes the problem for me.
There are more unchecked occurrences of division by (bar.max - bar.min) throughout the scrollbar code, some of them may cause similar problems later on.
def trackPos:Number = bind ((trackLength - thumbLength) * ((bar.value - bar.min) / (bar.max - bar.min)));
But sometimes bar.max == bar.min (e.g. for invisible scrollbar inside textbox where max = min = 0). This leads to division by 0 causing trackPos to be NaN.
This breaks dirty area management in mobile runtime and makes multiline textbox unusable.
Defining track pos as
def trackPos:Number = bind if (bar.max - bar.min > 0) ((trackLength - thumbLength) * ((bar.value - bar.min) / (bar.max - bar.min))) else 0
fixes the problem for me.
There are more unchecked occurrences of division by (bar.max - bar.min) throughout the scrollbar code, some of them may cause similar problems later on.