Skip to content

Prevent submitting form when pressing enter in transfer location search

What does this MR do and why?

Related to #393198 (closed)

If you press enter in the Transfer group dropdown search it submits the form because of the way HTML form behavior works in browsers. This MR adds @keydown.enter.prevent to the search input so it does not submit the form.

Originally I started migrating to GlCollapsableListbox but then realized that doesn't yet support infinite scroll for grouped options which we need. I have decided to fix this bug and then opened #498137 to address the migration.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordingsfff

Before After
Screen_Recording_2024-10-07_at_1.58.42_PM Screen_Recording_2024-10-07_at_1.58.01_PM

How to set up and validate locally

  1. Go to a group you own -> Settings -> General -> Advanced
  2. Open the dropdown in Transfer group section
  3. Type in the search input then press enter
  4. The form should not submit
Edited by Peter Hegman

Merge request reports

Loading