Home › Forums › ACF PRO › ACF PRO Select delete last selected value › Reply To: ACF PRO Select delete last selected value
Ok i have some news.
Autor of this plugin uses code:
$("#e15").select2("container").find("ul.select2-choices").sortable({
containment: 'parent',
start: function() {
$("#e15").select2("onSortStart");
},
update: function() {
$("#e15").select2("onSortEnd");
}
});
I look into code of this plugin. Method onSotrStart hide search field, and onSortEnd show it. Then I read something on jQuery UI page: api.jqueryui.com/sortable/#event-update
“update event: This event is triggered when the user stopped sorting and the DOM position has changed.”
This is true, but only when we mix values (tags). When we place tag on search field or move tag sligly to the side, DOM does not change. That’s why instead of use update event you should use stop event.
http://api.jqueryui.com/sortable/#event-stop
stop: function() {
$("#e15").select2("onSortEnd");
}
I check and its work very well 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.