brianvoe / slim-select

Slim advanced select dropdown
http://slimselectjs.com
MIT License
1.04k stars 196 forks source link

afterChange event somehow triggering call stack error (bootstrap) #563

Closed bfalchuk closed 3 weeks ago

bfalchuk commented 3 weeks ago

I am creating a simple handler for afterChange in my slimselect:

$(document).ready(function(){
    console.log('treegraph-util: doc ready..');
    //$('#select_search').selectpicker({size:10});
    select_search = new SlimSelect({
        select: '#select_search',
        data: [],
        events:{
            afterChange:(newVal) => {
                handle_search_selection(newVal);
            }
        }//events
      });
});

In my handler i check the items attributes (such as name) then i do other things like open a Bootstrap 5 offcanvas and/or open a Bootstrap 5 modal. I'm seeing this error and i'm not sure why. Any insights anyone? The handler does NOT re-open or do anything with the slimselect widget.. :

bootstrap-5.0.2.min.js:6 Uncaught RangeError: Maximum call stack size exceeded.
    at HTMLDocument.<anonymous> (bootstrap-5.0.2.min.js:6:37703)
    at HTMLDocument.s (bootstrap-5.0.2.min.js:6:5578)
    at HTMLDocument.<anonymous> (bootstrap-5.0.2.min.js:6:33295)
    at HTMLDocument.s (bootstrap-5.0.2.min.js:6:5578)
    at HTMLDocument.<anonymous> (bootstrap-5.0.2.min.js:6:37703)
    at HTMLDocument.s (bootstrap-5.0.2.min.js:6:5578)
    at HTMLDocument.<anonymous> (bootstrap-5.0.2.min.js:6:33295)
    at HTMLDocument.s (bootstrap-5.0.2.min.js:6:5578)
    at HTMLDocument.<anonymous> (bootstrap-5.0.2.min.js:6:37703)
    at HTMLDocument.s (bootstrap-5.0.2.min.js:6:5578)
brianvoe commented 3 weeks ago

If you have somewhere i can look at it I might be able to help. Even if i did though i dont think this is a slim select issue. Looks like your stuck in a loop call. How do you think this is a slim select issue?

bfalchuk commented 3 weeks ago

closing this for now as I dont have the means to debug this, and you're right it may not be a slimselect thing; could be some combination of the usage of the slimselect event and the bootstrap 5 modals and canvas trigger events, but i'm just guessing for now..