Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'top' of undefined #2163

Closed
ex1st opened this issue Dec 14, 2018 · 2 comments
Closed

Cannot read property 'top' of undefined #2163

ex1st opened this issue Dec 14, 2018 · 2 comments

Comments

@ex1st
Copy link
Contributor

ex1st commented Dec 14, 2018

Version of bootstrap "3.4.0"
Version of bootstrap-select "1.13.5"

Error throws if a container does not exist (maybe deleted from DOM).

/* can be changed to 
if (that.options.container && $container.length && !$container.is('body')) {
*/
if (that.options.container && !$container.is('body')) {
    containerPos = $container.offset();
    containerPos.top += parseInt($container.css('borderTopWidth')); // <--- this place
    containerPos.left += parseInt($container.css('borderLeftWidth'));
} else {
      containerPos = { top: 0, left: 0 };
}
@ex1st
Copy link
Contributor Author

ex1st commented Jan 2, 2019

Hi @caseyjhol, I've prepared example - https://codepen.io/ex1st/pen/VqyGdo
Thank you.

@caseyjhol
Copy link
Member

Released in v1.13.6!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants