Skip to content

Commit

Permalink
feat(SearchBox): add placeholder props to the underlying input element
Browse files Browse the repository at this point in the history
* Original commit: 3994106
* Original author: @Heedster
* Closes #115
* Closes #136
  • Loading branch information
Heedster authored and tomchentw committed Dec 7, 2015
1 parent 099cc8e commit e6a6a02
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/SearchBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ export default class SearchBox extends Component {
if (!canUseDOM) {
return;
}
const {mapHolderRef, classes, style, ...searchBoxProps} = this.props;
const {mapHolderRef, classes, style, placeholder, ...searchBoxProps} = this.props;

// Cannot create input via component - Google Maps will mess with React's internal state by detaching/attaching.
// Allow developers to style the "hidden element" via inputClasses.
let domEl = document.createElement("input");
domEl.className = classes;
domEl.type = "text";

domEl.placeholder = placeholder;

for (var propKey in style) {
if (style.hasOwnProperty(propKey)) {
domEl.style[propKey] = style[propKey];
Expand Down

0 comments on commit e6a6a02

Please sign in to comment.