diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps/code/components/Search.js')
-rw-r--r-- | server/sonar-web/src/main/js/apps/code/components/Search.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/js/apps/code/components/Search.js b/server/sonar-web/src/main/js/apps/code/components/Search.js index 60522b0f759..97cba288b03 100644 --- a/server/sonar-web/src/main/js/apps/code/components/Search.js +++ b/server/sonar-web/src/main/js/apps/code/components/Search.js @@ -19,8 +19,10 @@ */ import React, { Component } from 'react'; import { connect } from 'react-redux'; +import classNames from 'classnames'; import { search, selectCurrent, selectNext, selectPrev } from '../actions'; +import { translateWithParameters } from '../../../helpers/l10n'; class Search extends Component { @@ -44,7 +46,7 @@ class Search extends Component { dispatch(selectNext()); break; default: - // do nothing + // do nothing } } @@ -57,6 +59,9 @@ class Search extends Component { render () { const { query } = this.props; + const inputClassName = classNames('search-box-input', { + 'touched': query.length > 0 && query.length < 3 + }); return ( <form @@ -70,12 +75,15 @@ class Search extends Component { onKeyDown={this.handleKeyDown.bind(this)} onChange={this.handleSearch.bind(this)} value={query} - className="search-box-input" + className={inputClassName} type="search" name="q" placeholder="Search" maxLength="100" autoComplete="off"/> + <div className="note"> + {translateWithParameters('select2.tooShort', 3)} + </div> </form> ); } |