harvesthq / chosen

Deprecated - Chosen is a library for making long, unwieldy select boxes more friendly.
http://harvesthq.github.io/chosen/
Other
21.85k stars 4.1k forks source link

I am getting required result but i am getting and an exception in my console and which is i am given below #3104

Open ahmadbjs opened 3 years ago

ahmadbjs commented 3 years ago

Steps

1. ` _react2.default.createElement( 'select', { name: 'account', className: 'accountSelect chzn-select form-control', defaultValue: this.state.account,

                    // onChange: this.onChangeAccount},
                    onChange:  $(".chzn-select").chosen().change(this.onChangeAccount)},

                accountNodes
            ),`
  1.               ` onChangeAccount: function onChangeAccount(e) {
        $(".chzn-select").trigger(
        account = parseInt(e.target.value),
        this.setState({ account: account }),
        this.setState({ address: 0 }),
        this.loadAddressesFromServer(account),
        $(".chzn-select").chosen("destroy"),
    
        );
                 },`

Expected behavior

I am getting my desired result on my site but i am also getting those errors which is given below

Actual behavior

jquery.min.js:4 Uncaught TypeError: p.indexOf is not a function at Object.trigger (jquery.min.js:4) at HTMLSelectElement. (jquery.min.js:4) at Function.each (jquery.min.js:2) at m.fn.init.each (jquery.min.js:2) at m.fn.init.trigger (jquery.min.js:4) at Object.onChangeAccount (m2admin-salesperson-edit.js:207) at HTMLSelectElement.dispatch (jquery.min.js:4) at HTMLSelectElement.r.handle (jquery.min.js:4) at Object.trigger (jquery.min.js:4) at HTMLSelectElement. (jquery.min.js:4)

Environment

Additional information

Any other information you want to share that is relevant to the issue being reported. This might include the lines of code that you have identified as causing the bug, or potential solutions and workarounds.