You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flex.apache.org by "Erik de Bruin (JIRA)" <ji...@apache.org> on 2014/12/23 15:53:13 UTC

[jira] [Resolved] (FLEX-34657) SelectedIndices order is messed up

     [ https://issues.apache.org/jira/browse/FLEX-34657?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Erik de Bruin resolved FLEX-34657.
----------------------------------
       Resolution: Fixed
    Fix Version/s: Apache Flex 4.14.0

I even threw in some Mustella tests ;-)

> SelectedIndices order is messed up
> ----------------------------------
>
>                 Key: FLEX-34657
>                 URL: https://issues.apache.org/jira/browse/FLEX-34657
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: List
>    Affects Versions: Apache Flex 4.13.0
>            Reporter: Chris Velevitch
>            Assignee: Erik de Bruin
>             Fix For: Apache Flex 4.14.0
>
>         Attachments: Main.mxml
>
>
> The order of the existing selected indices is reversed each time a item is selected or deselected.
> In spark.components.list.as, the function calculateSelectedIndices at line 1646, the loop is using splice to rebuild the selected indices. This is reversing the order of the previously selected indices before adding the new item. The loop should be using push to preserve the original order.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Re: [jira] [Created] (FLEX-34657) SelectedIndices order is messed up

Posted by Erik de Bruin <er...@ixsoftware.nl>.
Justin,

Can you please follow up on the status of your claim that the fix
doesn't fix the issue?

EdB



On Sun, Dec 28, 2014 at 8:58 AM, Erik de Bruin <er...@ixsoftware.nl> wrote:
>> 1. Select multiple items by holding down shift
>> 2. Unselect and select the last selected item
>
> In this case, Shift-click selecting items 2 - 5 gives me '4,3,2,1' as
> expected (remember, for some reason the indices are stored "in
> reverse"); then deselecting (Ctrl/Cmd-click) 5 gives '3,2,1' (as
> expected), and reselecting (Ctrl/Cmd-click) it adds it to the front,
> giving '4,3,2,1' again.
>
> What do you see when you repeat the above steps?
>
>> 1. Select the first item
>> 2. Add additional items one by one going down the list (Order ends up being the rather strange 5,3,1,2,4)
>
> Mine is 5,4,3,2,1,0 after the entire - Ctrl/Cmd-clicked - selection.
> Where is your first item, i.e. index 0?
>
>> 3. Unselect and select a single selected item
>
> Unselecting item 4 (index 3), removes it from the list, giving
> '5,4,2,1,0'; re-selecting it again places it at the front of the list,
> giving '3,5,4,2,1,0' as expected.
>
> I'm unable to reproduce your inability to reproduce, I'm afraid. Can
> you verify you have tried this on a cleanly installed and built SDK
> (either 'develop' or 'release4.14' branch), please?
>
> EdB
>
>
>
> --
> Ix Multimedia Software
>
> Jan Luykenstraat 27
> 3521 VB Utrecht
>
> T. 06-51952295
> I. www.ixsoftware.nl



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

Re: [jira] [Created] (FLEX-34657) SelectedIndices order is messed up

Posted by Erik de Bruin <er...@ixsoftware.nl>.
> 1. Select multiple items by holding down shift
> 2. Unselect and select the last selected item

In this case, Shift-click selecting items 2 - 5 gives me '4,3,2,1' as
expected (remember, for some reason the indices are stored "in
reverse"); then deselecting (Ctrl/Cmd-click) 5 gives '3,2,1' (as
expected), and reselecting (Ctrl/Cmd-click) it adds it to the front,
giving '4,3,2,1' again.

What do you see when you repeat the above steps?

> 1. Select the first item
> 2. Add additional items one by one going down the list (Order ends up being the rather strange 5,3,1,2,4)

Mine is 5,4,3,2,1,0 after the entire - Ctrl/Cmd-clicked - selection.
Where is your first item, i.e. index 0?

> 3. Unselect and select a single selected item

Unselecting item 4 (index 3), removes it from the list, giving
'5,4,2,1,0'; re-selecting it again places it at the front of the list,
giving '3,5,4,2,1,0' as expected.

I'm unable to reproduce your inability to reproduce, I'm afraid. Can
you verify you have tried this on a cleanly installed and built SDK
(either 'develop' or 'release4.14' branch), please?

EdB



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

Re: [jira] [Created] (FLEX-34657) SelectedIndices order is messed up

Posted by Erik de Bruin <er...@ixsoftware.nl>.
I will check when I get back to my computer.

EdB



On Sunday, December 28, 2014, Justin Mclean <ju...@classsoftware.com>
wrote:

> Hi,
>
> > Ah, I see. My fix is for Ctrl-click selection.
>
> The second example I gave just uses Ctrl-click (or command click on the
> mac) selection, that's not fixed either.
>
> Thanks,
> Justin
>
>

-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

Re: [jira] [Created] (FLEX-34657) SelectedIndices order is messed up

Posted by Erik de Bruin <er...@ixsoftware.nl>.
Meanwhile, would you mind running:

./mini_run.sh tests/components/List/Properties/SparkList_Properties.mxml

Does that fail completely? Or does that at least seem to cover a use
case that IS solved?

EdB



On Sun, Dec 28, 2014 at 6:34 AM, Justin Mclean <ju...@classsoftware.com> wrote:
> Hi,
>
>> Ah, I see. My fix is for Ctrl-click selection.
>
> The second example I gave just uses Ctrl-click (or command click on the mac) selection, that's not fixed either.
>
> Thanks,
> Justin
>



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

Re: [jira] [Created] (FLEX-34657) SelectedIndices order is messed up

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> Ah, I see. My fix is for Ctrl-click selection.

The second example I gave just uses Ctrl-click (or command click on the mac) selection, that's not fixed either.

Thanks,
Justin


Re: [jira] [Created] (FLEX-34657) SelectedIndices order is messed up

Posted by Erik de Bruin <er...@ixsoftware.nl>.
Ah, I see. My fix is for Ctrl-click selection. You're looking at
Shift-click. So, it's a partial fix at best. I'm looking forward to your
contribution towards a full fix.

I agree the issue should remain open, awaiting a more thorough resolution.

EdB



On Saturday, December 27, 2014, Justin Mclean <ju...@me.com> wrote:

> Hi,
>
> From the JIRA:
>
> > The order of the existing selected indices is reversed each time a item
> is selected or deselected.
>
> This still occurs:
> 1. Select multiple items by holding down shift
> 2. Unselect and select the last selected item
>
> Result: The indices is reversed each time you select or unselect an item.
>
> And this also occurs:
> 1. Select the first item
> 2. Add additional items one by one going down the list (Order ends up
> being the rather strange 5,3,1,2,4)
> 3. Unselect and select a single selected item
>
> Result: The order of the selected indexes is reversed when you select or
> unselect a single item.
>
> So the bug is not fixed.
>
> That function uses splice in several locations (and also in other
> functions eg adjustSelectionAndCaretUponNavigation).Changing in one place
> but not others seems risky and may lead to side effects.
>
> Does anyone know the reason why splice is used and not push. Performance
> perhaps? Any there any known issue with vectors and push?
>
> Thanks,
> Justin



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

Re: [jira] [Created] (FLEX-34657) SelectedIndices order is messed up

Posted by Justin Mclean <ju...@me.com>.
Hi,

From the JIRA:

> The order of the existing selected indices is reversed each time a item is selected or deselected.

This still occurs:
1. Select multiple items by holding down shift
2. Unselect and select the last selected item

Result: The indices is reversed each time you select or unselect an item.

And this also occurs:
1. Select the first item
2. Add additional items one by one going down the list (Order ends up being the rather strange 5,3,1,2,4)
3. Unselect and select a single selected item

Result: The order of the selected indexes is reversed when you select or unselect a single item.

So the bug is not fixed.

That function uses splice in several locations (and also in other functions eg adjustSelectionAndCaretUponNavigation).Changing in one place but not others seems risky and may lead to side effects.

Does anyone know the reason why splice is used and not push. Performance perhaps? Any there any known issue with vectors and push?

Thanks,
Justin

Re: [jira] [Created] (FLEX-34657) SelectedIndices order is messed up

Posted by Erik de Bruin <er...@ixsoftware.nl>.
Take a better look at the actual issue and the fix and close this JIRA
again, please.

If you don't like the way the selected indices are ordered ("in reverse"),
you are of course free to raise a new JIRA. Changing that particular
behavior, however, will be a lot more involved and will probably break
backwards compatibility at several points.

EdB



On Saturday, December 27, 2014, Justin Mclean <ju...@classsoftware.com>
wrote:

> Hi,
>
> Sorry but I just tested this and it's not fixed in the current 4.14 RC.
>
> Justin
>


-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

Re: [jira] [Resolved] (FLEX-34657) SelectedIndices order is messed up

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

Sorry but I just tested this and it's not fixed in the current 4.14 RC.

Justin

Re: [jira] [Resolved] (FLEX-34657) SelectedIndices order is messed up

Posted by OmPrakash Muppirala <bi...@gmail.com>.
On Tue, Dec 23, 2014 at 6:53 AM, Erik de Bruin (JIRA) <ji...@apache.org>
wrote:

>
>      [
> https://issues.apache.org/jira/browse/FLEX-34657?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
> ]
>
> Erik de Bruin resolved FLEX-34657.
> ----------------------------------
>        Resolution: Fixed
>     Fix Version/s: Apache Flex 4.14.0
>
> I even threw in some Mustella tests ;-)
>

Whoa!


>
> > SelectedIndices order is messed up
> > ----------------------------------
> >
> >                 Key: FLEX-34657
> >                 URL: https://issues.apache.org/jira/browse/FLEX-34657
> >             Project: Apache Flex
> >          Issue Type: Bug
> >          Components: Spark: List
> >    Affects Versions: Apache Flex 4.13.0
> >            Reporter: Chris Velevitch
> >            Assignee: Erik de Bruin
> >             Fix For: Apache Flex 4.14.0
> >
> >         Attachments: Main.mxml
> >
> >
> > The order of the existing selected indices is reversed each time a item
> is selected or deselected.
> > In spark.components.list.as, the function calculateSelectedIndices at
> line 1646, the loop is using splice to rebuild the selected indices. This
> is reversing the order of the previously selected indices before adding the
> new item. The loop should be using push to preserve the original order.
>
>
>
> --
> This message was sent by Atlassian JIRA
> (v6.3.4#6332)
>