Commit 6772eb3a authored by Simon Knox's avatar Simon Knox

Merge branch '287620-fix-broken-group-dashboard' into 'master'

Fix console errors when changing filter

See merge request gitlab-org/gitlab!49628
parents 49b8714b 333e44f6
...@@ -7,6 +7,19 @@ export default { ...@@ -7,6 +7,19 @@ export default {
GlPopover, GlPopover,
GlBadge, GlBadge,
}, },
methods: {
/**
* BVPopover retrieves the target during the `beforeDestroy` hook to deregister attached
* events. Since during `beforeDestroy` refs are `undefined`, it throws a warning in the
* console because we're trying to access the `$el` property of `undefined`. Optional
* chaining is not working in templates, which is why the method is used.
*
* See more on https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49628#note_464803276
*/
target() {
return this.$refs.badge?.$el;
},
},
}; };
</script> </script>
...@@ -22,7 +35,7 @@ export default { ...@@ -22,7 +35,7 @@ export default {
'The vulnerability is no longer detected. Verify the vulnerability has been fixed or removed before changing its status.', 'The vulnerability is no longer detected. Verify the vulnerability has been fixed or removed before changing its status.',
) )
" "
:target="() => $refs.badge.$el" :target="target"
:title="__('Vulnerability remediated. Review before resolving.')" :title="__('Vulnerability remediated. Review before resolving.')"
placement="top" placement="top"
triggers="hover focus" triggers="hover focus"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment