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

  • Home
  • SEARCH
  • 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 9134953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:45:30+00:00 2026-06-17T08:45:30+00:00

I have a application that has jquery draggable div in it. I have placed

  • 0

I have a application that has jquery draggable div in it.
I have placed four text fields inside the draggable div to get input from user.

Aspx:

    <div id="divAdd" runat="server">
    <input id="txtCode" placeholder="Location Code" maxlength="20" 
    type="text" runat="server" />
    <input id="txtName" placeholder="Location Code" maxlength="20" 
    type="text" runat="server" />
    ...
    </div>
    <div>

Javascript:

 $("#divAdd").draggable({ cursor: 'move', containment: '#divmap',
                drag: function () {
                    fnHandleMove();
                }
            });

I cant place the cursor in those textfield in IPAD by tapping on it. However Desktop version works fine.

If i comment out that javascript part, i am able to place the cursor and keypad shows.

Is this bug with jquery UI-draggable or i am doing anything wrong?

Apart from JqueryUI.js i use JqueryTouchPunch.js and JSPlumb.js in the application.

Any help will be appreciated.

  • 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-17T08:45:31+00:00Added an answer on June 17, 2026 at 8:45 am

    OK here’s a solution if your textfield whatever HTML element is, isn’t focusing,scrolling, selecting words, moving text cursor around the text and whatever different scenarios might come then you may override the jquery.ui.touch.punch.js script. I assume that your element isn’t the draggable one but probably a child of it as my case was.

    Put a class on your html element, for example class="useDefault".
    Then go to the script file and find that part:

    ...
    function simulateMouseEvent (event, simulatedType) {
    
        // Ignore multi-touch events
        if (event.originalEvent.touches.length > 1) {
          return;
        }
    
        event.preventDefault();
    
        var touch = event.originalEvent.changedTouches[0],
            simulatedEvent = document.createEvent('MouseEvents');
    ....
    

    As you can probably see event.preventDefault(); assures that jquery.ui.touch.punch.js
    overrides the default behaviors of the browser. To prevent that for our particular class node, make the following modifications:

    if (event.originalEvent.touches.length > 1) {
      return;
    }
    var touch = event.originalEvent.changedTouches[0],
      simulatedEvent = document.createEvent('MouseEvents');
    //As you can see here is your class element check
    if (touch.target.className === "useDefault") {
      event.stopPropagation();
    } else {
      event.preventDefault();
    }
    

    This solution is tested with webkit browsers only and jQuery UI Touch Punch 0.2.2 release.

    Hope that quick solution helps, BR

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

Sidebar

Related Questions

I have a ruby on rails application with an input text field that has
I have ASP.NET MVC application that has list with jQuery Selectable list. My problem
I have an ASP.NET MVC application that has a jQuery Treeview and a jQuery
I have a MVC application that has a Jquery Post $.post(virtualPath + cookie +
I have a rails app that has an jquery ui autocomplete search input. It
I have a JQuery Mobile (1.0rc1) application that has a list view with a
I have a recursive jQuery function that has something like this: parentItem.find('> div:first-child >
I have an application that has 2 beans with the same name, but which
We have an application that has a database full of polygons (currently stored as
I have a application that has an activity that shows message logs. The thing

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.