inputpicker icon indicating copy to clipboard operation
inputpicker copied to clipboard

width issue

Open fammifarendra opened this issue 5 years ago • 1 comments

I have error whenever i resize the page

jquery.inputpicker.js:79 Uncaught TypeError: Cannot read property 'width' of undefined at _set (jquery.inputpicker.js:79) at _setWrappedListWidthAndHeight (jquery.inputpicker.js:47) at jquery.inputpicker.js:39 at dispatch (jquery.min.js:2) at y.handle (jquery.min.js:2)

fammifarendra avatar Jun 18 '19 10:06 fammifarendra

so i change a bit the code to silence the error,

function _setWrappedListWidthAndHeight(input) { var inputpicker_div = _getInputpickerDiv(input); var wrapped_list = _getWrappedList(); // var setWidth = _set(input, 'width'); <--- error from this var setWidth = "100%"; var width, height; if (setWidth.substr(-1) == '%') { var p = parseInt(setWidth.slice(0, -1)); width = parseInt(p * inputpicker_div.outerWidth() / 100); } else { width = setWidth ? setWidth : inputpicker_div.outerWidth(); } // height = _set(input, 'height'); <--- error from this height = 200; wrapped_list.css({ width: width, maxHeight: height, overflowY: 'auto' }) }

fammifarendra avatar Jun 18 '19 11:06 fammifarendra