Support

Account

Home Forums ACF PRO ACF PRO Select delete last selected value

Solved

ACF PRO Select delete last selected value

  • In new select field (added in ACF PRO) you can search by typing.
    After finding several values, you can move it in this field. But if you start to move them, search by typing ceases to be active

    1) search something by typing
    2) move the selected values
    3) search no longer avaible

  • Hi @kartofelek007

    Thanks for the bug report. Are you able to open your console log and watch for any JS errors when you sort the selected items?

  • After some test i found that this is issue of selec2 plugin.
    When you drag value directly on the [search field] and this search field cant move on beter place, they got “display:none”. But you can fix this by another “dragging-mix values”.

    http://ivaynberg.github.io/select2/
    You can test this on “Select2 Drag and Drop” section

  • Hi @kartofelek007

    Thanks for the info. What browser are you using? i am unable to drop a tag onto the search in the demo. As soon as I start dragging, the search disappears and I can drop on it.

  • Hi @kartofelek007

    Thanks for the video. I can see the issue but unable to replicate it. Are you mac or PC? Also, are you able to submit an issue to select2 with all this info? That would be awesome.

    Cheers mate

  • 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 🙂

  • Hi @kartofelek007

    You are a legend!

    I’ll do some testing and add this in to the next version. Nice debugging and code find!

  • Yep, I’ve just swapped update for stop, and the problem is gone.

    Just to clarify for anyone reading, the issue occurs when dragging a choice, but not modifying the order (dragging a few pixels). Then when you stop dragging, the input field is forever hidden.

    This is now fixed as of the next version 5.0.9

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘ACF PRO Select delete last selected value’ is closed to new replies.