Commit 084d4a57 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ph/6488/approversSelectDebounce' into 'master'

Fix approver select debounce

See merge request gitlab-org/gitlab!84264
parents e22e94ce 71358ace
...@@ -104,6 +104,11 @@ export default { ...@@ -104,6 +104,11 @@ export default {
}, },
}, },
mounted() { mounted() {
const query = debounce(
({ term, callback }) => this.fetchGroupsAndUsers(term).then(callback),
500,
);
import(/* webpackChunkName: 'select2' */ 'select2/select2') import(/* webpackChunkName: 'select2' */ 'select2/select2')
.then(() => { .then(() => {
// eslint-disable-next-line promise/no-nesting // eslint-disable-next-line promise/no-nesting
...@@ -117,10 +122,7 @@ export default { ...@@ -117,10 +122,7 @@ export default {
closeOnSelect: false, closeOnSelect: false,
formatResult, formatResult,
formatSelection, formatSelection,
query: debounce(({ term, callback }) => { query,
// eslint-disable-next-line promise/no-nesting
return this.fetchGroupsAndUsers(term).then(callback);
}, 250),
id: ({ type, id }) => `${type}${id}`, id: ({ type, id }) => `${type}${id}`,
}) })
.on('change', (e) => this.onChange(e)); .on('change', (e) => this.onChange(e));
......
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