Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8345425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:40:01+00:00 2026-06-09T06:40:01+00:00

We have a nested menu within our page where drag and drop is enabled

  • 0

We have a nested menu within our page where drag and drop is enabled to reorder and nest menu items..

There seems to be an issue (we are using jQuery 1.7.2 and UI 1.8.22) where if you have both a sortable and droppable, the tolerance for sorting is not consistent and is causing an issue.

An example is going to explain it better than I can…

http://jsfiddle.net/8fUxV/5/

I have just created the minimum needed to show the issue, and not the nested menus, merely the mechanism we are using to make it work.

Pick up “Item 4” and very slowly drag it upwards. 3 will become highlighted, meaning that is the target for the drop. Fine, but keep moving up until it is in the gap between 2 and 3. I want to drop it here and cause a sort. But if I do, as 3 is still highlighted, it will “drop” instead (and in our real code, create a nested menu).

There are actually a few pixels just before item 2, where you can get the desired effect. However, if you move down too far, it will again drop instead of sort.

Essentially, the issue is that I would think if the item were in the gap it should sort and only drop when I am over the other highlighted item.

I have a part workaround, that forces UI to recalculate the positions – uncomment the code in the “out” function.

Now whilst you still get the same problem if you drag 4 upwards, if you touch 2 and move back down into the gap, nothing is highlighted so it will sort correctly.

But the issue remains that the first drag upwards doesn’t work as you would expect on that first rearrange.

(I did try adding the workaround into the _mousedrag of ui.sortable in the jquery.ui code, and it does solve the problem….but I have no idea what I’m doing in there 🙂

So I’m not sure if I am doing something wrong or if this a bug?

Has anyone come across something similar before I log a bug report?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T06:40:03+00:00Added an answer on June 9, 2026 at 6:40 am

    After digging through the source, I found an option that fixes the issue.

    The problem is that the position are not calculated correctly when an item is moved around and the dummy placeholder is inserted within the list.

    You need to add this to your sortable,

    refreshPositions: true
    

    e.g.

    $("ul").sortable({
        helper: "original",
        refreshPositions: true,
        update: function(event, ui) {
           :
        }
    });
    

    This causes it to recalculate position on each and every mouse movement. Extremely inefficient, but it just won’t work otherwise.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a nested master page scenario where I have a menu both in
I have this website where on the left menu there's a nested menu on
I have a nested menu like this: <ul id=menu> <li>Home <ul> <li>New</li> <li class=selected>Open</li>
I have an image that has a nested context menu defined in the XAML
I have a CSS <ul> <li> nested menu that works perfectly in IE 8
I have a vertical nav menu that is made up of nested lists, however
I have a fairly large, three level deep, menu consisting of nested lists like
I have a menu on the left of my page that is made of
I have a nested ul menu structure that starts off like this: <div id=left>
I have this script for my CSS Vertical Menu: //Nested Side Bar Menu (Mar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.