Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 346065
Collapse All | Expand All

(-)js/org/eclipse/swt/widgets/Combo.js (-5 / +7 lines)
Lines 308-313 Link Here
308
        // Temporary make the text field ReadOnly, when the list is dropped.
308
        // Temporary make the text field ReadOnly, when the list is dropped.
309
        if( this._editable ) {
309
        if( this._editable ) {
310
          this._field.setReadOnly( !this._dropped  );
310
          this._field.setReadOnly( !this._dropped  );
311
          if( !this._dropped ) {
312
            this._field._visualizeBlur();
313
          } else {
314
            this._field._visualizeFocus();
315
          }
311
        }
316
        }
312
        if( !this._dropped ) {
317
        if( !this._dropped ) {
313
          // Brings this widget on top of the others with same parent.
318
          // Brings this widget on top of the others with same parent.
Lines 562-569 Link Here
562
          }
567
          }
563
          break;
568
          break;
564
      }
569
      }
565
      if(    this._field.isCreated()
570
      if( this._field.isCreated() && !org.eclipse.swt.EventUtil.getSuspended() )
566
          && !org.eclipse.swt.EventUtil.getSuspended() ) 
567
      {
571
      {
568
        this._handleSelectionChange();
572
        this._handleSelectionChange();
569
      }
573
      }
Lines 612-620 Link Here
612
          }
616
          }
613
          break;
617
          break;
614
      }
618
      }
615
      if(    this._field.isCreated()
619
      if( this._field.isCreated() && !org.eclipse.swt.EventUtil.getSuspended() ) {
616
          && !org.eclipse.swt.EventUtil.getSuspended() ) 
617
      {
618
        this._handleSelectionChange();
620
        this._handleSelectionChange();
619
      }
621
      }
620
      if( evt.getCharCode() !== 0 ) {
622
      if( evt.getCharCode() !== 0 ) {
(-)js/org/eclipse/rwt/test/tests/ComboTest.js (-1 / +27 lines)
Lines 144-149 Link Here
144
      combo.destroy();
144
      combo.destroy();
145
    },
145
    },
146
146
147
    testTextfieldFocus : function() {
148
      // See Bug 346065 - [Combo] Selection can sometimes not be changed with key up/down in FF4
149
      if( org.eclipse.rwt.Client.isGecko() && org.eclipse.rwt.Client.getVersion() >= 2 ) {
150
        // NOTE: The test is theoratically valid for all browser, but only FF4 has this problem,
151
        //       and document.activeElement is not be available on all browser
152
        var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
153
        var combo = this._createDefaultCombo();
154
        combo.setEditable( true );
155
        assertTrue( combo.isFocusable() );
156
        combo.focus();
157
        testUtil.flush();
158
        assertIdentical( combo._field._inputElement, document.activeElement );
159
        testUtil.click( combo._button );
160
        testUtil.flush();
161
        assertIdentical( document.body, document.activeElement );
162
        testUtil.click( combo._button );
163
        testUtil.flush();
164
        assertIdentical( combo._field._inputElement, document.activeElement );
165
        combo.blur();
166
        testUtil.flush();
167
        assertIdentical( document.body, document.activeElement );
168
        combo.destroy();
169
      }
170
    },
171
147
    testListPopUpBehavior : function() {
172
    testListPopUpBehavior : function() {
148
      var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
173
      var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
149
      var combo = this._createDefaultCombo();
174
      var combo = this._createDefaultCombo();
Lines 158-164 Link Here
158
      assertTrue( combo._list.isSeeable() );
183
      assertTrue( combo._list.isSeeable() );
159
      combo.destroy();
184
      combo.destroy();
160
    },
185
    },
161
   
186
162
    testListHeight : function() {
187
    testListHeight : function() {
163
      var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
188
      var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
164
      var combo = this._createDefaultCombo();
189
      var combo = this._createDefaultCombo();
Lines 199-204 Link Here
199
    _createDefaultCombo : function() {
224
    _createDefaultCombo : function() {
200
      var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
225
      var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
201
      var combo = new org.eclipse.swt.widgets.Combo();
226
      var combo = new org.eclipse.swt.widgets.Combo();
227
      combo.setTabIndex( 1 );
202
      combo.setSpace( 239, 81, 6, 23 );
228
      combo.setSpace( 239, 81, 6, 23 );
203
      combo.setListItemHeight( 19 );
229
      combo.setListItemHeight( 19 );
204
      combo.setEditable( false );
230
      combo.setEditable( false );

Return to bug 346065