PolymerElements / iron-selector

Manages a list of elements that can be selected
32 stars 55 forks source link

default next/prev to first/last when no selection #128

Closed 43081j closed 6 years ago

43081j commented 8 years ago

Fixes #124.

When no selection has been made:

If you're wondering why I check that selected !== undefined, it is so (if somehow) non-existent selections are made, nothing will be selected.

43081j commented 8 years ago

@bicknellr any chance you can get this merged?

bicknellr commented 6 years ago

If you're wondering why I check that selected !== undefined, it is so (if somehow) non-existent selections are made, nothing will be selected.

Should the this.selected = this._indexToValue(index); be inside the if in both cases then?

43081j commented 6 years ago

thanks for taking a look at this russell. will be nice to get it unforgotten and merged if we want it

as for what you said above, it looks like i was talking nonsense..

its a year or two old so i dont quite remember what i was talking about. but the code looks right to me... if selected isn't set yet, we default to the appropriate boundary (0 or length-1), otherwise we do what we did before this PR.

do you see a problem with that logic? (i could be missing something?)

also i will rebase onto master soon

bicknellr commented 6 years ago

Ok, I realize now that my suggestion doesn't make sense given the goal of this PR. The logic here looks fine as it is.

43081j commented 6 years ago

@bicknellr no worries. i've rebased onto master now so it should be mergeable if you'd like to

bicknellr commented 6 years ago

Thanks!

bicknellr commented 6 years ago

BTW, releases now happen on a two week schedule following some extra testing. You can probably expect this to be in a tagged release by late next week.