diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5956db227..706b384d1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,10 @@
+* Added `spellcheck` to the list of `input` attributes that are inherited by selectize.
+
+ *@winzig*
+
## v0.12.4, v0.12.5 ยท 27 June 2018
* Allow the dropdown to reopen on click if it is closed without losing focus
@@ -8,7 +12,6 @@
*@fishpercolator*
-
* Fixed bug making `clearOptions` function. Now it doesn't remove already selected options.
*(thanks @caseymct - #1079)*
diff --git a/src/selectize.js b/src/selectize.js
index 854727595..b0215fd33 100644
--- a/src/selectize.js
+++ b/src/selectize.js
@@ -179,6 +179,10 @@ $.extend(Selectize.prototype, {
if ($input.attr('autocapitalize')) {
$control_input.attr('autocapitalize', $input.attr('autocapitalize'));
}
+
+ if ($input.attr('spellcheck')) {
+ $control_input.attr('spellcheck', $input.attr('spellcheck'));
+ }
$control_input[0].type = $input[0].type;
self.$wrapper = $wrapper;
diff --git a/test/setup.js b/test/setup.js
index 38ad01887..f0cbc00c6 100644
--- a/test/setup.js
+++ b/test/setup.js
@@ -47,14 +47,16 @@
});
describe('', function() {
it('should propagate original input attributes to the generated input', function() {
- var test = setup_test('', {});
+ var test = setup_test('', {});
expect(test.selectize.$control_input.attr('autocorrect')).to.be.equal('off');
expect(test.selectize.$control_input.attr('autocapitalize')).to.be.equal('none');
+ expect(test.selectize.$control_input.attr('spellcheck')).to.be.equal('false');
});
it('should not add attributes if not present in the original', function() {
var test = setup_test('', {});
expect(test.selectize.$control_input.attr('autocorrect')).to.be.equal(undefined);
expect(test.selectize.$control_input.attr('autocapitalize')).to.be.equal(undefined);
+ expect(test.selectize.$control_input.attr('spellcheck')).to.be.equal(undefined);
});
});
});