Magicsuggest / magicsuggest

Multiple Selection Combo Box using Bootstrap 3
nicolasbize.com/magicsuggest/
1.3k stars 269 forks source link

jQuery 4Beta Changes #357

Closed stack-its closed 6 months ago

stack-its commented 7 months ago

I noticed that in jQuery4 beta the following need to get updated in MagicSuggest:

$.isArray to Array.isArray() $.trim to variable.trim() $.proxy to variable.bind(handler)

There might be other deprecations, but that is what I found today.

Please let me know if I could change those myself & what the variables would be. Thanks.

zergioz commented 7 months ago

Please do. And I'll merge it. Thanks for the help.

stack-its commented 7 months ago

I've never merged before so this is new to me ;) I'm looking at v2.1.4, as that is what I'm running right now, but I need to understand the proxy calls a bit better. Here's an example: ms.container.on('focus', $.proxy(handlers._onFocus, this));

So is ms.container getting a proxy added to it? If so, would this work? ms.container.on('focus', ms.container.bind(handlers._onFocus, this)); Let me know. Thanks.

zergioz commented 7 months ago

You don't have to merge. 1) Clone the repo 2) Make a branch 3) Push the branch 4) Create a Pull Request

I will review and merge or make changes as needed.

stack-its commented 7 months ago

I still need an answer about that example line of code, so I know if it's written properly for the plugin.

zergioz commented 7 months ago

It should work. Since $.Proxy is deprecated. I am currently cleaning up the code to bring it up to date. I'll make those changes and let you know.

stack-its commented 7 months ago

Just curious how close you are to patching these issues? Thanks.

zergioz commented 7 months ago

Im working on getting pushed by the end of the week.

zergioz commented 7 months ago

Download the following branch and let me know how it works: https://github.com/Magicsuggest/magicsuggest/tree/jquery-deprecated-updates.

stack-its commented 7 months ago

Sorry for the delay - I've been updating a bunchof stuff in my products. I used the magicsuggest.min.js from download above and got an error - looks like 'this' is not defined for some reason - hopefully it's an easy fix:

magic_suggest_error
zergioz commented 6 months ago

Did you download the branch I linked above? It should not have that code. Let me know.

stack-its commented 6 months ago

Yes I downloaded the branch that you linked above & here it is in the magicsuggest.min.js file on line #47: (P.S. shouldn't be lines in min file except for the credits at beginning)

this_in_minfile
zergioz commented 6 months ago

Don't use the Minified version. I need to erase that thing.

stack-its commented 6 months ago

Ok, the full version seems to run fine. Will it be long before this version gets released or are you still working on stuff? Thanks

zergioz commented 6 months ago

I am still working on cleaning up the code, but I will probably release a minor version later this week. PS: I was waiting for your feedback before making more changes.