Deselecting a label messes the count of labels

Summary

Deselecting a label on a MR messes up the description of the labels

Steps to reproduce

  • Create a new MR.
  • Click on the dropdown with labels.
  • Select a label.
  • Without closing the dropdown deselect the same label.

Expected behavior

Do not show the deselected label and do not mess the count of labels.

Actual behavior

You can still see the label on the description even though you have it deselected. If this thing is repeated it increases the count of labels.

Relevant logs and/or screenshots

gitlab-2

Results of GitLab environment info

  • Gitlab selfhosted CE 8.15.1