Skip to content

Auto-selects labels created in dropdown

Nick Leonard requested to merge nl-select-created-label into master

What does this MR do and why?

Automatically selects labels created through the dropdown using "Create new label" and clears the search to return to a selection state. Previously, label was created but not selected. Selection is not saved until dropdown is closed (no change in behavior).

This completes the flow started in Pre-fill create label form (!116590 - merged)

What does this MR not do and why?

  • This does not attempt to change the behavior when using the non-sidebar component, such as on the New Issue form or MR form.
    • This is a different component built in HAML

Screenshots or screen recordings

Original (pre-!116590) Before After
labels_old labels_new autocreate

Closes https://gitlab.com/gitlab-org/gitlab/-/issues/338124

How to set up and validate locally

  1. Open an issue or MR
  2. Open the label selector ("Edit")
  3. Enter a search term that doesn't match an existing label
  4. Click "Create project label", optionally edit the label
  5. Click "Create"
  6. Confirm the label you created is selected (you may need to search if you have many labels)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Nick Leonard

Merge request reports