Browse Source

SONAR-11717 Fix searchbox focus

tags/7.7
Jeremy Davis 5 years ago
parent
commit
ce57491039

+ 2
- 0
server/sonar-web/src/main/js/apps/groups/components/__tests__/__snapshots__/EditMembers-test.tsx.snap View File

@@ -247,6 +247,7 @@ exports[`should edit members 2`] = `
</ul>
<div
class="search-box"
title=""
>
<input
aria-label="search_verb"
@@ -493,6 +494,7 @@ exports[`should edit members 2`] = `
>
<div
className="search-box"
title=""
>
<input
aria-label="search_verb"

+ 1
- 0
server/sonar-web/src/main/js/components/controls/SearchBox.css View File

@@ -66,6 +66,7 @@
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
pointer-events: none;
}

.search-box-input:focus ~ .search-box-magnifier {

+ 5
- 4
server/sonar-web/src/main/js/components/controls/SearchBox.tsx View File

@@ -131,7 +131,10 @@ export default class SearchBox extends React.PureComponent<Props, State> {
const tooShort = minLength !== undefined && value.length > 0 && value.length < minLength;

return (
<div className={classNames('search-box', this.props.className)} id={this.props.id}>
<div
className={classNames('search-box', this.props.className)}
id={this.props.id}
title={tooShort ? translateWithParameters('select2.tooShort', minLength!) : ''}>
<input
aria-label={translate('search_verb')}
autoComplete="off"
@@ -162,9 +165,7 @@ export default class SearchBox extends React.PureComponent<Props, State> {
)}

{tooShort && (
<span
className="search-box-note"
title={translateWithParameters('select2.tooShort', minLength!)}>
<span className="search-box-note">
{translateWithParameters('select2.tooShort', minLength!)}
</span>
)}

+ 1
- 0
server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/SearchBox-test.tsx.snap View File

@@ -3,6 +3,7 @@
exports[`renders 1`] = `
<div
className="search-box"
title=""
>
<input
aria-label="search_verb"

Loading…
Cancel
Save