@@ -1182,11 +1182,15 @@ public void remove (int index) {
11821182 Option [] oldOptions = selectInput .options ;
11831183 if (0 > index && index > oldOptions .length - 1 )
11841184 error (SWT .ERROR_INVALID_RANGE );
1185+ if (selectInput .selectedIndex == index ){
1186+ noSelection =true ;
1187+ }
11851188 Option [] newOptions = new Option [oldOptions .length - 1 ];
11861189 System .arraycopy (oldOptions ,0 , newOptions , 0 , index );
11871190 System .arraycopy (oldOptions , index + 1 , newOptions , index , oldOptions .length - index - 1 );
11881191 selectInput .options = newOptions ;
11891192 itemCount --;
1193+
11901194}
11911195
11921196/**
@@ -1242,6 +1246,9 @@ public void remove (int start, int end) {
12421246 Option [] oldOptions = selectInput .options ;
12431247 if ((0 > start && start > oldOptions .length - 1 ) || (0 > end && end > oldOptions .length - 1 ))
12441248 error (SWT .ERROR_INVALID_RANGE );
1249+ if (start <= selectInput .selectedIndex && selectInput .selectedIndex <= end ){
1250+ noSelection = true ;
1251+ }
12451252 Option [] newOptions = new Option [oldOptions .length - (end - start + 1 )];
12461253 System .arraycopy (oldOptions ,0 , newOptions , 0 , start );
12471254 System .arraycopy (oldOptions , end + 1 , newOptions , start , oldOptions .length - end - 1 );
@@ -1270,6 +1277,9 @@ public void remove (String string) {
12701277 if (string == null ) error (SWT .ERROR_NULL_ARGUMENT );
12711278 int index = indexOf (string , 0 );
12721279 if (index == -1 ) error (SWT .ERROR_INVALID_ARGUMENT );
1280+ if (selectInput .selectedIndex == index ){
1281+ noSelection = true ;
1282+ }
12731283 remove (index );
12741284}
12751285
@@ -1289,6 +1299,7 @@ public void removeAll () {
12891299 * @j2sNative
12901300 * this.selectInput.options.length = 0;
12911301 */ {}
1302+ noSelection = true ;
12921303 itemCount = 0 ;
12931304 textInput .value = "" ;
12941305 sendEvent (SWT .Modify );
@@ -1483,9 +1494,10 @@ public void select (int index) {
14831494 }
14841495 */
14851496 if (index >= 0 && index < itemCount ){
1497+ noSelection = false ;
14861498 selectInput .selectedIndex = index ;
1499+ setText (getItem (index ));
14871500 }
1488- setText (getItem (index ));
14891501}
14901502/*
14911503void setBackgroundPixel (int pixel) {
0 commit comments