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

bootstrap-select.js:972 Uncaught TypeError: Cannot read property 'classList' of undefined #2193

Closed
meesha81 opened this issue Feb 8, 2019 · 1 comment

Comments

@meesha81
Copy link

meesha81 commented Feb 8, 2019

Hi,
this error:

bootstrap-select.js:972 Uncaught TypeError: Cannot read property 'classList' of undefined
at scroll (bootstrap-select.js:972)
at Selectpicker.createView (bootstrap-select.js:898)
at Selectpicker.setSize (bootstrap-select.js:1865)
at Selectpicker.refresh (bootstrap-select.js:2770)
.....

Caused when we are dynamically reloading options when typing with data-live-search="true".

Selectpicker should have "try/catch" for classList (that's our solution which is working fine). Item where the cursor is can be lost when we are reloading items and that's propably why crash occurs.

This issue is not about "ticked" items, because during dynamic reload of selectpicker options we have to return always all ticked.

Please, can you add some solution (eg as try/catch) that we do not modify manually every new version?

Our "workaround" by simple edit of script (add try/catch):
`
try {
active.classList.remove('active');
if (active.firstChild) active.firstChild.classList.remove('active');
} catch(e) {
}

`

@caseyjhol
Copy link
Member

Duplicate of #2189.

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