Hi Carlos,
I didn't have any lists in my Flex projects 😝 but I've made a small example so 
that we can see how Lists work in a standard way:

1º) 
https://drive.google.com/file/d/1nP-Z-07yI7qDfh4WwlTxnXaumWU4_YRh/view?usp=sharing
The example shows a spark List with scroll and we move with "the up and down 
keys".
In this case the selectedChange and the scrollToIndex go in unison.
Similar behavior in Jewel List, in Flex the positioning is only fixed in a row 
if it is not visible, in addition, it will fix the first row if we move up and 
the last if we do it down. In Jewel List the first row is always fixed, even if 
it is visible, and it does not take into account the direction of movement [1]
        
        [1] 
https://drive.google.com/file/d/1wm_MXhPpvEvGCmSgyMGnsJ1GG0lsAF-N/view?usp=sharing

2º) 
https://drive.google.com/file/d/1jYj99Zl-vWDqI4RbSOeP5CL4WBn1sCVp/view?usp=sharing
Same example but we move directly assigning the selectedItem to the list.
In this other case when the selectedIndex changes, the vertical scroll is not 
synchronized.
This is the behavior I am questioning, and it works the same as it did on the 
Spark List.

Hiedra.

-----Mensaje original-----
De: Maria Jose Esteve <[email protected]> 
Enviado el: lunes, 2 de noviembre de 2020 12:35
Para: [email protected]
Asunto: RE: Jewel List - selectionChange (Bis)

Yes Carlos, I just got my old pc back, I look at it and tell you.
Thank you.

Hiedra.

-----Mensaje original-----
De: Carlos Rovira <[email protected]> Enviado el: lunes, 2 de noviembre 
de 2020 11:55
Para: Apache Royale Development <[email protected]>
Asunto: Re: Jewel List - selectionChange (Bis)

Hi Maria Jose,

Thanks for taking a look at this. I must admit that I'm a bit surprised by the 
current behaviour. In my mind I think that was working that way, but I checked 
TDJ and seem it's not. Can you check if Flex has that behaviour by default? I 
don't remember how Flex behaved and I think it could be good to know it before 
taking action.

Thanks!

Carlos


El lun., 2 nov. 2020 a las 5:04, Maria Jose Esteve (<[email protected]>)
escribió:

> Hi,
> I have put together a small example that shows the current behavior of 
> a Jewel List when row changes [1].
> It's simple, the scroll movement does not depend on the selected row. 
> If we move to an "index" outside the limits of the visible area we 
> must call myList.scrollToIndex (myNewIndex) to force its display.
>
> [1]
> https://drive.google.com/file/d/17JYeqg5A3o5ub4MdD_icRmiQvuGab245/view
> ?usp=sharing
>
> In my view, these two behaviors go together at the presentation level, 
> in the view, and I think it is impractical for the developer to have 
> to remember that the command "position yourself at index x" does not 
> include "and show it to me" 😝
>
> Why not link them or at least give the possibility to configure it and 
> choose whether to do it or not?
>
> I see two options:
> 1st) Call scrollToIndex at the end of the selectionChangeHandler function.
> (We fix the behavior)
> 2nd) Create a bead that adds this functionality whenever you want.
>
> In my case, I have extended the ListView bead and override the 
> selectionChangeHandler function (first choice):
>
>         override protected function
> selectionChangeHandler(event:Event):void
>         {
>             super.selectionChangeHandler(event);
>             scrollToIndex(lastSelectedIndex);
>         }
>
> This solution works for me, but thinking about being able to 
> incorporate this possibility in the SDK, I don't know if the second 
> option would be more correct, creating a different bead that can be 
> added or not, depending on the situation. Would the second option be more 
> correct? ?
>
> I can think of a third option, which I think is the most versatile: 
> Create the new bead and also create a property in the List "autoscroll 
> = true / false", so that if autoscroll = true we would load the 
> automatically created bead.
>
> As you see?
>
> I appreciate any comments.
> Thank you.
> Hiedra.
>
>
>
> -----Mensaje original-----
> De: Andrew Wetmore <[email protected]> Enviado el: martes, 6 de 
> octubre de 2020 1:48
> Para: Apache Royale Development <[email protected]>
> Asunto: Re: Jewel List - selectionChange
>
>
>
> It seems to make good sense.
>
>
>
> On Mon., Oct. 5, 2020, 8:46 p.m. Carlos Rovira, 
> <[email protected] <mailto:[email protected]>>
>
> wrote:
>
>
>
> > I guess you mean a programmatic selection? not a user click or touch
> right?
>
> > (since for the later I guess we already have it visible to make the
>
> > selection, isn't it?).
>
> >
>
> > Don't see any problem with doing that, if nobody states something
>
> > against it we can implement it.
>
> >
>
> > Thanks
>
> >
>
> > El mar., 6 oct. 2020 a las 1:31, Maria Jose Esteve
>
> > (<[email protected]<mailto:[email protected]>>)
>
> > escribió:
>
> >
>
> > > Hello, I wanted to ask a question ... I'm sure there is an
>
> > > explanation that I can't see ...
>
> > > Why is it that when we select a row in a List control, a
>
> > > scrollToIndex is not performed to make it visible?
>
> > > Is there a situation where I insert a List control and don't want 
> > > to
>
> > > see the item I have selected? What am I missing?
>
> > >
>
> > > Thx.
>
> > > Hiedra
>
> > >
>
> >
>
> >
>
> > --
>
> > Carlos Rovira
>
> > http://about.me/carlosrovira
>
> >
>
>

--
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Reply via email to