Skip to content

Commit 645e04a

Browse files
committed
Corrections on #755
- Correct tests - Use hyphen instead of underscore in new node id
1 parent e6fb783 commit 645e04a

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

src/selectize.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ $.extend(Selectize.prototype, {
128128
$dropdown_content = $('<div>').addClass(settings.dropdownContentClass).appendTo($dropdown);
129129

130130
if(inputId = $input.attr('id')) {
131-
$control_input.attr('id', inputId + '_selectized');
132-
$('label[for='+inputId+']').attr('for', inputId + '_selectized');
131+
$control_input.attr('id', inputId + '-selectized');
132+
$('label[for='+inputId+']').attr('for', inputId + '-selectized');
133133
}
134134

135135
if(self.settings.copyClassesToDropdown) {

test/interaction.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,15 @@
104104

105105
it('should give it focus to select', function(done) {
106106
var inputId = "labeledSelect";
107-
$('#fixture').append('<label for="'+inputId+'">select</label>');
108-
var label = $('label[for="'+inputId+'"]');
107+
var label =
108+
$('<label for="'+inputId+'">select</label>').appendTo('form');
109109

110110
var test = setup_test('<select id="'+inputId+'">' +
111111
'<option value="a">A</option>' +
112112
'<option value="b">B</option>' +
113113
'</select>', {});
114114

115-
Syn
116-
.click(label)
115+
syn.click(label)
117116
.delay(0, function() {
118117
label.remove();
119118
expect(test.selectize.isFocused).to.be.equal(true);
@@ -123,13 +122,12 @@
123122

124123
it('should give it focus to input', function(done) {
125124
var inputId = "labeledInput";
126-
$('#fixture').append('<label for="'+inputId+'">input</label>');
127-
var label = $('label[for="'+inputId+'"]');
128-
125+
var label =
126+
$('<label for="'+inputId+'">input</label>').appendTo('form');
127+
129128
var test = setup_test('<input id="'+inputId+'" type="text" value="a,b,c,d">', {});
130129

131-
Syn
132-
.click(label)
130+
syn.click(label)
133131
.delay(0, function() {
134132
label.remove();
135133
expect(test.selectize.isFocused).to.be.equal(true);

0 commit comments

Comments
 (0)