1)
Option constructor takes 4 arguments, current implementation only takes 2.
New 3rd argument is boolean and is the value for defaultSelected property.
New 4th arguement is boolean and is the value for selected property.
This change also implements defaultSelected property (read only)
2)
Also, the constructor's first agument is the value for the text property not the label property. In the constructor, the first argument is now used to set the text content of the option tag, not the label attribute.
Attached patch for code and test
code and test patch
Logged In: YES
user_id=402164
Originator: NO
With which browser did you test? If I correctly remember, FF and IE don't behave the same here.
Logged In: YES
user_id=1750644
Originator: YES
Marc,
Our app hasn't shown any difference between FF and IE in this respect, but I will do some tests and confirm.
There is a browser specific difference in the interpretation of arguments when adding an Option to a Select, (Select.add(newOption, old)).
test html file to confirm FF and IE have same arguments for new Option()
Logged In: YES
user_id=1750644
Originator: YES
Have tested and both FF (5.1) and IE (6) behave the same. Test file attached.
File Added: test.html
Logged In: YES
user_id=402164
Originator: NO
Patch applied, thanks.
I've made a few changes:
- the unit test didn't work in my FF (select.add missing argument)
- changed get to is for defaultSelected
- changed the unit test to only rely on js to make check in real browser easier
- added support for the label property
Logged In: YES
user_id=402164
Originator: NO
Patch applied, thanks.
I've made a few changes:
- the unit test didn't work in my FF (select.add missing argument)
- changed get to is for defaultSelected
- changed the unit test to only rely on js to make check in real browser easier
- added support for the label property