Hi Carlos, If I will do the changes I make them on a branch, so you could test it.
Thanks, Piotr czw., 22 sie 2019 o 22:46 Carlos Rovira <[email protected]> napisał(a): > Hi Piotr, > > seems reasonable. Could you let me know your proposed change so I can test > it too? I can copy the lines in my end and try it in our app to see if > there's some colateral damage > > thanks > > > > El jue., 22 ago. 2019 a las 17:38, Piotr Zarzycki (< > [email protected]>) escribió: > > > Hi Guys, > > > > I run today in weird scenario where I'm getting "maximum call stack size > > exceeded" error. Following code makes freeze browser [1]. > > > > When my dataProvider is an empty ArrayList, DropDownListTextPrompt sets > in > > method forceSelection() selectedIndex to 0.[2] > > ArrayListSelectionModel make selectedIndex = -1, cause dataProvider is > > empty, but it also dispatch event "selectionChanged" [3]. > > Once that event is dispatched DropDownListTextPrompt receives it and call > > again forceSelection method - It end up in a dead end. > > > > In my opinion ArrayListSelectionModel shouldn't dispatch selectionChanged > > if selectedIndex didn't change and this is the case. > > > > Summarize everything. > > dataProvider = new ArrayList(); -> empty. > > 1. selectedIndex is equal -1 > > 2. selectedIndex is being set to 0 > > > > Due to empty dataProvider nothing has actually change, but even is being > > dispatch. > > > > Do you agree that it should be changed so ArrayListSelectionModel should > > dispatch selectionChanged event when really something has changed ? > > > > [1] https://paste.apache.org/hil50 > > [2] > > > > > https://github.com/apache/royale-asjs/blob/50592b55565b4ad8aa776a7ded403da2d70d54a4/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/dropdownlist/RequireSelection.as#L124 > > [3] > > > > > https://github.com/apache/royale-asjs/blob/50592b55565b4ad8aa776a7ded403da2d70d54a4/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/models/ArrayListSelectionModel.as#L253 > > > > Thanks, > > -- > > > > Piotr Zarzycki > > > > Patreon: *https://www.patreon.com/piotrzarzycki > > <https://www.patreon.com/piotrzarzycki>* > > > > > -- > Carlos Rovira > http://about.me/carlosrovira > -- Piotr Zarzycki Patreon: *https://www.patreon.com/piotrzarzycki <https://www.patreon.com/piotrzarzycki>*
