From 50026fad2ec28b850b6e1351f03aa7a792e2eb4d Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Wed, 16 May 2018 15:07:34 +0200 Subject: [PATCH] legend: fixes Firefox/baron scroll bug Compensates for Firefox scrollbar calculation error in the baron framework. Offsetwidth and clientwidth are used to find the width of the scrollbar. In the legend these differ by 9px and cause the scroll div to grow by 9px for every refresh. This fix compensates with a negative margin-right in that case. Fixes #11830 --- public/app/plugins/panel/graph/legend.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/app/plugins/panel/graph/legend.ts b/public/app/plugins/panel/graph/legend.ts index 6b6c89444dc..af61db396ba 100644 --- a/public/app/plugins/panel/graph/legend.ts +++ b/public/app/plugins/panel/graph/legend.ts @@ -287,6 +287,10 @@ module.directive('graphLegend', function(popoverSrv, $timeout) { destroyScrollbar(); legendScrollbar = baron(scrollbarParams); } + + // #11830 - compensates for Firefox scrollbar calculation error in the baron framework + scroller[0].style.marginRight = '-' + (scroller[0].offsetWidth - scroller[0].clientWidth) + 'px'; + legendScrollbar.scroll(); }