Commit fe4b8c75 authored by Coung Ngo's avatar Coung Ngo

Show 20 labels in dropdown instead of 5

When pressing ~ to show a list of labels, only 5 are shown. This can be
annoying for the user if there are more than 5 labels that start with
the same word but they can't see all matching labels in the autocomplete
list. This commit changes the list to show a maximum of 20 instead of 5.
parent e8790766
...@@ -337,6 +337,7 @@ class GfmAutoComplete { ...@@ -337,6 +337,7 @@ class GfmAutoComplete {
}, },
// eslint-disable-next-line no-template-curly-in-string // eslint-disable-next-line no-template-curly-in-string
insertTpl: '${atwho-at}${title}', insertTpl: '${atwho-at}${title}',
limit: 20,
callbacks: { callbacks: {
...this.getDefaultCallbacks(), ...this.getDefaultCallbacks(),
beforeSave(merges) { beforeSave(merges) {
......
---
title: Show 20 labels in dropdown instead of 5
merge_request: 17596
author:
type: fixed
...@@ -24,6 +24,10 @@ describe Projects::AutocompleteSourcesController, '(JavaScript fixtures)', type: ...@@ -24,6 +24,10 @@ describe Projects::AutocompleteSourcesController, '(JavaScript fixtures)', type:
create(:label, project: project, title: 'feature') create(:label, project: project, title: 'feature')
create(:label, project: project, title: 'documentation') create(:label, project: project, title: 'documentation')
create(:label, project: project, title: 'P1')
create(:label, project: project, title: 'P2')
create(:label, project: project, title: 'P3')
create(:label, project: project, title: 'P4')
get :labels, get :labels,
format: :json, format: :json,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment