Permalink
Browse files

Fix for mks2602164: <select> element with disabled attribute is not

disabled when navigation mode is on.

Fix for MKS2601991 - the currently selected index is picked to exclude
disabled items.

On the JS side, fixed logic glitch that prevented disabled="disabled"
items from being disabled correctly.
  • Loading branch information...
1 parent 82bb027 commit 53460898099be970b94322ea08f234b6df26da6a @ababut ababut committed Jan 3, 2012
@@ -77,12 +77,12 @@ private void populateChoiceStateArrays( Scriptable fromScriptableChoices, String
labels[ i ] = (String) choice.getField( "label" );
enabled[ i ] = ( (Boolean) choice.getField( "enabled" ) ).booleanValue();
- canSelect = allowMultiple || !firstSelected;
- selected[ i ] = canSelect && enabled[ i ] && ( (Boolean) choice.getField( "selected" ) ).booleanValue();
- firstSelected = firstSelected || selected[ i ];
-
type[ i ] = ( (String) choice.getField( "type" ) ).equals( "group" ) ? POPUP_ITEM_TYPE_GROUP
: POPUP_ITEM_TYPE_OPTION;
+
+ canSelect = (type[ i ] != POPUP_ITEM_TYPE_GROUP) && (allowMultiple || !firstSelected);
+ selected[ i ] = canSelect && enabled[ i ] && ( (Boolean) choice.getField( "selected" ) ).booleanValue();
+ firstSelected = firstSelected || selected[ i ];
}
} catch( Exception e ) {
throw new RuntimeException( e.getMessage() );
@@ -115,7 +115,7 @@ public Object getSelectedValue() {
public void fieldChanged( Field field, int arg1 ) {
for( int index = 0; index < _listItems.length; index++ ) {
if( _listItems[ index ].isSelected() ) {
- _response.addElement( new Integer( index ) );
+ _response.addElement( new Integer( _listItems[ index ].getIndex() ) );
}
}
Oops, something went wrong.

0 comments on commit 5346089

Please sign in to comment.