Fix console error during filter search
What does this MR do and why?
Fix console error during filter search. When users filter the dependency list, $refs.moreLink becomes undefined
during component re-render. This causes a console error when trying to access $refs.moreLink.$el for the popover target.
Issue: #515455 (closed)
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
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 recordings
Note: in this demo, I forced display the showMoreLink to highlight the error; hence, the data might look a bit odd
| Before (has errors) | After (no errors) |
|---|---|
| before-has-error | after-no-error |
![]() |
![]() |
How to set up and validate locally
Apply this patch to force display the show more link:
diff --git a/ee/app/assets/javascripts/dependencies/components/dependency_location.vue b/ee/app/assets/javascripts/dependencies/components/dependency_location.vue
index e3afeb86b992..24f41ba2ab94 100644
--- a/ee/app/assets/javascripts/dependencies/components/dependency_location.vue
+++ b/ee/app/assets/javascripts/dependencies/components/dependency_location.vue
@@ -66,6 +66,7 @@ export default {
return Math.max(0, this.ancestors.length - VISIBLE_DEPENDENCY_COUNT);
},
showMoreLink() {
+ return true;
return this.remainingDependenciesCount > 0;
},
nMoreMessage() {
Numbered steps to set up and validate the change are strongly suggested.
- Clone this project: https://gitlab.com/gitlab-examples/security/security-reports
- Run a successful pipeline
- Go to Project > Secure > Dependency list
- Search by component and it displays filtered dependency list
Related to #515455 (closed)

