diff --git a/src/Geosuggest.jsx b/src/Geosuggest.jsx
index f5c29d0c..214ff066 100644
--- a/src/Geosuggest.jsx
+++ b/src/Geosuggest.jsx
@@ -2,6 +2,7 @@
import React from 'react';
import GeosuggestItem from './GeosuggestItem'; // eslint-disable-line
+import inputAttributes from './input-attributes';
const Geosuggest = React.createClass({
/**
@@ -349,6 +350,14 @@ const Geosuggest = React.createClass({
* @return {Function} The React element to render
*/
render: function() {
+ const attributes = {};
+
+ inputAttributes.forEach(inputAttribute => {
+ if (this.props[inputAttribute]) {
+ attributes[inputAttribute] = this.props[inputAttribute];
+ }
+ });
+
return (// eslint-disable-line no-extra-parens
@@ -356,9 +365,8 @@ const Geosuggest = React.createClass({
className={'geosuggest__input ' + this.props.inputClassName}
ref="geosuggestInput"
type="text"
+ {...attributes}
value={this.state.userInput}
- placeholder={this.props.placeholder}
- disabled={this.props.disabled}
onKeyDown={this.onInputKeyDown}
onChange={this.onInputChange}
onFocus={this.onFocus}
diff --git a/src/input-attributes.js b/src/input-attributes.js
new file mode 100644
index 00000000..9f32a998
--- /dev/null
+++ b/src/input-attributes.js
@@ -0,0 +1,30 @@
+/**
+ * Attributes allowed on input elements
+ */
+export default [
+ 'autocapitalize',
+ 'autocomplete',
+ 'autocorrect',
+ 'autofocus',
+ 'autosave',
+ 'disabled',
+ 'form',
+ 'formaction',
+ 'formenctype',
+ 'formmethod',
+ 'formnovalidate',
+ 'formtarget',
+ 'height',
+ 'inputmode',
+ 'maxlength',
+ 'maxlength',
+ 'name',
+ 'pattern',
+ 'placeholder',
+ 'readonly',
+ 'required',
+ 'selectionDirection',
+ 'size',
+ 'spellcheck',
+ 'tabindex'
+];