-
Notifications
You must be signed in to change notification settings - Fork 95
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
Implement autocomplete for search #1589
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1589 +/- ##
=========================================
Coverage 70.58% 70.58%
Complexity 1647 1647
=========================================
Files 32 32
Lines 4321 4321
=========================================
Hits 3050 3050
Misses 1271 1271 ☔ View full report in Codecov by Sentry. |
resource/js/vocab-search.js
Outdated
v-model="searchTerm" | ||
@input="autoComplete()" | ||
@keyup.enter="gotoSearchPage()" | ||
@click=""> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit heavy handed to I disable the bootstap-determined onClick listener from the text box like so.
…the autocomplete delay
… links through entity controller
Changed the way special characters are handled for the search itself, and how the matching part of the search results are displayed. Also changed URL parameters into URLSearchParams objects, and adjusted cypress tests to reflect these changes. 👍 |
…Fi/Skosmos into issue1514-search-bar-autocomplete
…side the element (including the search field)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some minor suggestions for CSS.
In the Vue component, I would change the way the visibility of the dropdown list is handled. Instead of removing and adding the list's class directly, I would use a variable and bind the class in the template. It works the way it's done now, but IMO it would be a little cleaner to use Vue's own functionality.
The event listener for clicking outside the component could be done using a custom directive like in the other Vue components, but this isn't probably necessary as it seems to work fine now.
Otherwise the code looks good and the component seems to work as intended.
Co-authored-by: UnniKohonen <[email protected]>
Quality Gate passedIssues Measures |
Link to relevant issue(s), if any
Autocomplete functionality for #1514
Description of the changes in this PR
This PR introduces a Bootstrap 5 dropdown menu for autocomplete, and it aims to fulfill the basic functionality of the search bar's autocomplete part.
Known problems or uncertainties in this PR
Checklist
.sr-only
class, color contrast)