From 76f688dfee920edfd5928068712be9e3d9cc8cb4 Mon Sep 17 00:00:00 2001 From: Tom Doan Date: Sun, 12 Feb 2017 16:32:01 +0800 Subject: [PATCH] Improve upon last fix --- dist/js/jquery.prettydropdowns.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dist/js/jquery.prettydropdowns.js b/dist/js/jquery.prettydropdowns.js index 78d8aa8..8febbdc 100644 --- a/dist/js/jquery.prettydropdowns.js +++ b/dist/js/jquery.prettydropdowns.js @@ -1,5 +1,5 @@ /*! - * jQuery Pretty Dropdowns Plugin v3.1.2 by T. H. Doan (http://thdoan.github.io/pretty-dropdowns/) + * jQuery Pretty Dropdowns Plugin v3.1.3 by T. H. Doan (http://thdoan.github.io/pretty-dropdowns/) * * jQuery Pretty Dropdowns by T. H. Doan is licensed under the MIT License. * Read a copy of the license in the LICENSE file or at @@ -192,8 +192,11 @@ $clone.remove(); } // Set dropdown width and event handler - // Add 0.5px slack to prevent missing right border with scrollbar - $dropdown.children('li').width(nWidth+0.5).click(function() { + // NOTE: Setting width using width(), then css() because width() only can + // return a float, which can result in a missing right border when there + // is a scrollbar. + $dropdown.children('li').width(nWidth); + $dropdown.children('li').css('width', $dropdown.children('li').css('width')).click(function() { var $li = $(this); // Only update if different value selected if ($dropdown.hasClass('active') && $li.data('value')!==$dropdown.children('li.selected').data('value')) {