From 377dbe19b3fa4ccfe0d0aee5445071a741b57518 Mon Sep 17 00:00:00 2001 From: sarahghp Date: Mon, 25 Mar 2019 13:41:10 -0400 Subject: Add test to work with inline-block elements --- .../javascripts/vue_shared/components/tooltip_on_truncate.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/vue_shared/components/tooltip_on_truncate.vue b/app/assets/javascripts/vue_shared/components/tooltip_on_truncate.vue index 69eb791d195..b977731f4f1 100644 --- a/app/assets/javascripts/vue_shared/components/tooltip_on_truncate.vue +++ b/app/assets/javascripts/vue_shared/components/tooltip_on_truncate.vue @@ -31,7 +31,11 @@ export default { mounted() { const target = this.selectTarget(); - if (target && target.scrollWidth > target.offsetWidth) { + if ( + target && + (target.scrollWidth > target.offsetWidth || + target.offsetWidth > target.parentElement.offsetWidth) + ) { this.showTooltip = true; } }, -- cgit v1.2.1