From 674b5b89b7fc4af9ad22078adc2bbf5ca9003075 Mon Sep 17 00:00:00 2001 From: Algirdas Brazas Date: Wed, 8 Feb 2017 10:45:14 +0200 Subject: [PATCH] Wrong input width calculated Search input width is currently calculated by subtracting 10 pixels from it's second parent width. But it should be the same, as the drop-down button width. --- src/uiSelectController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uiSelectController.js b/src/uiSelectController.js index e304279d4..1239f0377 100644 --- a/src/uiSelectController.js +++ b/src/uiSelectController.js @@ -522,7 +522,7 @@ uis.controller('uiSelectCtrl', ctrl.sizeSearchInput = function() { var input = ctrl.searchInput[0], - container = ctrl.searchInput.parent().parent()[0], + container = ctrl.searchInput.parent()[0], calculateContainerWidth = function() { // Return the container width only if the search input is visible return container.clientWidth * !!input.offsetParent; @@ -531,7 +531,7 @@ uis.controller('uiSelectCtrl', if (containerWidth === 0) { return false; } - var inputWidth = containerWidth - input.offsetLeft - 10; + var inputWidth = containerWidth - input.offsetLeft; if (inputWidth < 50) inputWidth = containerWidth; ctrl.searchInput.css('width', inputWidth+'px'); return true;