#5206·hrms

Roster: Shift Type field visually clears after selecting an option with overlapping search results

Author: quocthanhnguyenCreated Sep 4, 2026Updated Sep 4, 2026
Labelsbug

Information about bug

When creating a New Shift Assignment from the Roster page (/hr/roster), the "Shift Type" field appears to reset to empty right after selecting an option, if the search results contain another option that is a prefix of the selected one (e.g. searching "07:00-12:00" returns both "07:00-12:00" and "07:00-12:00_Nature").

Steps to reproduce:

  1. Go to /hr/roster
  2. Click an empty cell to open "New Shift Assignment"
  3. In "Shift Type", type a search text that matches multiple Shift Types sharing a common prefix (e.g. one plain name and one with a suffix like "_Nature")
  4. Click either matching option

Expected: the Shift Type field shows the selected value. Actual: the field visually resets to empty, as if nothing was selected.

Note: the underlying value is NOT actually lost -- submitting the form does save the correct shift_type. It's purely a display bug in the Autocomplete dropdown.

Root cause: in apps/hrms/roster/src/components/Link.vue, selecting a value clears the Autocomplete's search query, which (after a 300ms debounce) triggers Link.vue to reload options via search_link with an empty search text. This unfiltered "default" result page doesn't always include the just-selected value (e.g. when it's alphabetically outside the default page), so frappe-ui's Autocomplete component can no longer resolve the selected value to a matching option and displays it as empty.

Suggested fix: in Link.vue's options resource transform, always ensure the currently selected modelValue is present in the returned options list even if the search/reload result doesn't include it.

Module

HR

Version

Frappe version - v16.32.0 ERPNext version - v16.33.0 Frappe HR version - v16.16.0

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

bash

Code of Conduct

  • I agree to follow this project's Code of Conduct