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

Calling selectOption result in Uncaught RangeError: Maximum call stack size exceeded #391

Open
sumitparkash opened this issue Sep 26, 2018 · 0 comments

Comments

@sumitparkash
Copy link

sumitparkash commented Sep 26, 2018

When you try to call the selectOption inside the change method ,it result in
Uncaught RangeError: Maximum call stack size exceeded

I need to reset the value of the select box to default once the user select a option. So i try to set the selectOption(0) on the change event . Here is the code

 <select id="test" name="test" >
            <option value="SelectBoxIt is:">SelectBoxIt is:</option>
            <option value="a jQuery Plugin">a jQuery Plugin</option>
            <option value="a Select Box Replacement">a Select Box Replacement</option>
            <option value="a Stateful UI Widget">a Stateful UI Widget</option>
        </select>
    $(function ($) {  
            var el = $('select#test');
            el.selectBoxIt();
            el.on('change', function (e) {
               var selectBox = el.data("selectBox-selectBoxIt");
               selectBox.selectOption(0);
            })
    });
</script>

But results in error

Could you possible suggest any solution.

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

1 participant