|
29 | 29 |
|
30 | 30 | it('should close dropdown after selection made if closeAfterSelect: true', function(done) {
|
31 | 31 | var test = setup_test('<select multiple>' +
|
32 |
| - '<option value="a">A</option>' + |
33 |
| - '<option value="b">B</option>' + |
| 32 | + '<option value="a">A</option>' + |
| 33 | + '<option value="b">B</option>' + |
34 | 34 | '</select>', {closeAfterSelect: true});
|
35 | 35 |
|
36 |
| - click(test.selectize.$control, function() { |
37 |
| - click($('[data-value=a]', test.selectize.$dropdown_content), function() { |
38 |
| - expect(test.selectize.isOpen).to.be.equal(false); |
39 |
| - expect(test.selectize.isFocused).to.be.equal(true); |
40 |
| - done(); |
41 |
| - }); |
| 36 | + click(test.selectize.$control, function() { |
| 37 | + click($('[data-value=a]', test.selectize.$dropdown_content), function() { |
| 38 | + expect(test.selectize.isOpen).to.be.equal(false); |
| 39 | + expect(test.selectize.isFocused).to.be.equal(true); |
| 40 | + done(); |
42 | 41 | });
|
| 42 | + }); |
| 43 | + }); |
| 44 | + |
| 45 | + it('should close and blur dropdown after selection made if closeAfterSelect: true and in single mode' , function(done) { |
| 46 | + var test = setup_test('<select>' + |
| 47 | + '<option value="a">A</option>' + |
| 48 | + '<option value="b">B</option>' + |
| 49 | + '</select>', {closeAfterSelect: true}); |
| 50 | + |
| 51 | + click(test.selectize.$control, function() { |
| 52 | + expect(test.selectize.isOpen).to.be.equal(true); |
| 53 | + expect(test.selectize.isFocused).to.be.equal(true); |
| 54 | + click($('[data-value=a]', test.selectize.$dropdown_content), function() { |
| 55 | + expect(test.selectize.isOpen).to.be.equal(false); |
| 56 | + expect(test.selectize.isFocused).to.be.equal(false); |
| 57 | + done(); |
| 58 | + }); |
| 59 | + }); |
43 | 60 | });
|
44 | 61 |
|
45 | 62 | describe('clicking control', function() {
|
|
0 commit comments