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

Click association item the cursor focus on search input. and page always scroll to bottom. #36

Open
kamwing opened this issue Aug 15, 2014 · 12 comments

Comments

@kamwing
Copy link

kamwing commented Aug 15, 2014

when i click association item the cursor will focus on selectize search input.

I think this is conflict with reorder item feature. ( in the case of many items ) and i click any of item the page will scroll down and focus on search input.

@nilshoerrmann
Copy link
Contributor

Which version are you using?

@kamwing
Copy link
Author

kamwing commented Aug 15, 2014

version 1.1.0

@nilshoerrmann
Copy link
Contributor

Thanks. My guess is that this is a conflict with the Selectize plugin. I'll have a look next week.

@kamwing
Copy link
Author

kamwing commented Aug 15, 2014

Is the selectize plugin's input field in the label tags issue?

@nilshoerrmann
Copy link
Contributor

Selectize tends to always open the search as soon as anything changed in the selection. We are actively stopping this behaviour and though we hide the dropdown already, it seems like the focus get still set to the search.

@kamwing
Copy link
Author

kamwing commented Sep 4, 2014

hi @nilshoerrmann :)
I was reformat /symphony/assets/js/symphony.min.js and find the Selectize code in lines from 4152 to 4162

setActiveItem: function(b, c) {
    var d, e, f, g, h, i, j, k, l = this;
    if ("single" !== l.settings.mode) {
        if (b = a(b), !b.length) return a(l.$activeItems).removeClass("active"), l.$activeItems = [], void(l.isFocused && l.showInput());
        if (d = c && c.type.toLowerCase(), "mousedown" === d && l.isShiftDown && l.$activeItems.length) {
            for (k = l.$control.children(".active:last"), g = Array.prototype.indexOf.apply(l.$control[0].childNodes, [k[0]]), h = Array.prototype.indexOf.apply(l.$control[0].childNodes, [b[0]]), g > h && (j = g, g = h, h = j), e = g; h >= e; e++) i = l.$control[0].childNodes[e], -1 === l.$activeItems.indexOf(i) && (a(i).addClass("active"), l.$activeItems.push(i));
            c.preventDefault()
        } else "mousedown" === d && l.isCtrlDown || "keydown" === d && this.isShiftDown ? b.hasClass("active") ? (f = l.$activeItems.indexOf(b[0]), l.$activeItems.splice(f, 1), b.removeClass("active")) : l.$activeItems.push(b.addClass("active")[0]) : (a(l.$activeItems).removeClass("active"), l.$activeItems = [b.addClass("active")[0]]);
        l.hideInput(), this.isFocused || l.focus()
    }
},

i was delete blow code in last line and solved this issue

, this.isFocused || l.focus()

@jdsimcoe
Copy link

👍 I'm having the same issue and it is ANNOYING when trying to re-order large association sets.

@jdsimcoe
Copy link

This doesn't solve the issue for me @kamwing. It just reverses the problem and causes it to scroll to the top after you release focus.

@nilshoerrmann
Copy link
Contributor

I'll have a look at this next week. Haven't been able to come up with a simple solution yet.

@jdsimcoe
Copy link

@nilshoerrmann the behavior is now the opposite and it scrolls to the top upon dragging entries:

video

@nilshoerrmann
Copy link
Contributor

Uh? How's that possible?
Will have to investigate.

@nilshoerrmann nilshoerrmann reopened this Sep 15, 2014
@nilshoerrmann
Copy link
Contributor

I'm still not sure what is causing this issue and how to fix it properly.
Jonathan, does this problem also occur when you sort fields in the secion editor or does it only happen using the Selector UI?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants