Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(PWA): Autocomplete search functionality in Link component (backport #2127) #2128

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Aug 28, 2024

Problem

The Autocomplete search functionality in the Link component was not properly triggering API calls to frappe.desk.search.search_link when users entered search queries. This resulted in a non-responsive search experience, where users couldn't see updated options based on their input. The options were limited to 10 and if documents are more than 10 you wont be able to search the rest of the documents.

WhatsApp Image 2024-08-20 at 9 33 07 PM (2)

Solution
This PR addresses the issue by restructuring how we handle query changes in the Autocomplete component:

  1. Added an @update:query event handler to the Autocomplete component in the template.
  2. Implemented a new handleQueryUpdate function to manage query changes efficiently.
  3. Removed the problematic watcher for autocompleteRef.value?.query that wasn't reliably detecting changes.
  4. Ensured that the reloadOptions function is called with the updated query, triggering the API call to fetch new options.

Screenshot from 2024-08-28 02-09-00

https://github.com/frappe/hrms/issues/2120


This is an automatic backport of pull request #2127 done by [Mergify](https://mergify.com).

@mergify mergify bot requested a review from ruchamahabal as a code owner August 28, 2024 07:03
@ruchamahabal ruchamahabal merged commit fe1d710 into version-15-hotfix Aug 28, 2024
8 checks passed
@mergify mergify bot deleted the mergify/bp/version-15-hotfix/pr-2127 branch August 28, 2024 07:26
@frappe-pr-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 15.27.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants