Skip to content
Snippets Groups Projects
Commit 0c64f618 authored by Loïc Correnson's avatar Loïc Correnson Committed by Loïc Correnson
Browse files

[ivette] limite hints

parent f3f3ae25
No related branches found
No related tags found
No related merge requests found
...@@ -383,7 +383,8 @@ function scrollToRef(r: null | HTMLLabelElement): void { ...@@ -383,7 +383,8 @@ function scrollToRef(r: null | HTMLLabelElement): void {
function Suggestions(props: SuggestionsProps): JSX.Element { function Suggestions(props: SuggestionsProps): JSX.Element {
const { hints, onHint, index, onClose } = props; const { hints, onHint, index, onClose } = props;
const suggestions = hints.map((h, k) => { const theHints = hints.length > 100 ? hints.slice(0,100) : hints;
const suggestions = theHints.map((h, k) => {
const selected = k === index || hints.length === 1; const selected = k === index || hints.length === 1;
const classSelected = selected && 'dome-xToolBar-searchIndex'; const classSelected = selected && 'dome-xToolBar-searchIndex';
const className = classes('dome-xToolBar-searchItem', classSelected); const className = classes('dome-xToolBar-searchItem', classSelected);
...@@ -414,6 +415,7 @@ function Suggestions(props: SuggestionsProps): JSX.Element { ...@@ -414,6 +415,7 @@ function Suggestions(props: SuggestionsProps): JSX.Element {
onMouseDown={(event) => event.preventDefault()} onMouseDown={(event) => event.preventDefault()}
> >
{suggestions} {suggestions}
{hints.length > 100 ? <Label>({hints.length - 100} omitted)</Label> : null}
</div> </div>
); );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment