首页 > 解决方案 > 灰盒渲染 react-google-maps 的 StandaloneSearchBox

问题描述

我有下一个错误:表单图像中的灰色框

当我从 react-google-maps 渲染 StandaloneSearchBox 导入时,有时会在文本输入上出现或消失那个灰色框

这是我的代码:

render() {
new window.google.maps.places.SearchBox('HOL');
return (
  <div className="g-autocomplete">
    <StandaloneSearchBox
    
      onPlacesChanged={this.onPlacesChanged}
      ref={searchBox => { this.searchBox = searchBox; }}
      >
      <input
        className={this.props.className ? this.props.className : ''}
        type="text"
        placeholder={this.props.placeholder ? this.props.placeholder : ''}
        style={this.state.defaultStyle}
      />
      
    </StandaloneSearchBox>
    
  </div>



);

}

标签: javascriptcssreactjsgoogle-mapsgoogle-api

解决方案


推荐阅读