Closed Hi-Fi closed 11 years ago
I'm at the moment really stumbled, what your change does.
if (items.length != 0) {
and
if (items.length < 1) {
should do exactly the same. items is a array and length therefor from 0 to n.
What am I missing?
Point is, that all values should be selected within the if clause only, if user doesn't give any items to select (so, when list length is 0).
In python code same:
if not items:
for i in range(len(select.options)):
select.select_by_index(i)
return
Old code wen to clause, if list wasn't empty, which was wrong, and which is handled in code after the if-clause.
OMG!
if (items.length != 0) {
is not the same as
if (items.length < 1) {
but
if (items.length == 0) {
Thanks for that catch!
That also has quite a big impact to performance, especially if long lists are used (one reason, that I last time moved back to Python version).
Compared code with Python version, there was an error how keyword is handled if no values given.
Also added some comments to that, and new integration test that checks selection of value from (onChange()) dropdown.