What is causing textareas and text input fields inside sortable divs to be uneditable in all browsers except Chrome?

I have a group of draggable elements displayed using the jQuery UI widget.

During testing in Chrome, everything works perfectly. However, in other browsers, there seem to be issues. It appears that Chrome handles the functionality better compared to other browsers.

If you have an idea of why the jQuery UI sortable widget may be causing issues in non-Chrome browsers, feel free to share. The code and markup are provided below for reference.

Here is the relevant jQuery code snippet (with a test callback function):

$(".editContainer").sortable({
    revert: true,
    cursor: "move",
    stop: function (event, ui) {
        $(this).find(".editObjectsTable").each(function () {
            console.log($(this).find(".pageOrderNum").text());
        });
    }
});

Corresponding HTML code snippet:

<div class="editContainer">
    <table class="editObjectsTable">
        ...
    </table>
</div>

Here is the relevant CSS code snippet:

div.editContainer
{
    width: 94%;
    height: 400px;
    overflow-y: scroll;
    ...
}

...

Behavior Summary:

Chrome:

The functionality works perfectly.

IE 10:

Experiences glitches, especially with the jQuery sortable widget. Compatibility with IE is not a priority for this web app.

Firefox:

Issues with text input fields - unable to reposition cursor or highlight text.

Other Browsers:

Compatibility with other browsers is not a priority, but it would be beneficial to work in Firefox as well.

For a live demonstration, you can check out the jsFiddle provided.

Any insights on what might be causing these browser-specific issues?

Additional Info:

The doctype being used is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

Answer №1

After completing the sorting process, if you find that you are unable to edit any input boxes, you can rectify this issue with a simple solution:

$( "#sortable" ).enableSelection();

For instance, in the following example:

         $("#myId tbody").sortable({
             group: 'no-drop',
             handle: '#id',

             start: function (event, ui) {

             },

            stop: function (event, ui) {

            }

    }).disableSelection();

Answer №2

Repeated CSS code has been detected in both table.editObjectsTable and .editObjectsTable selectors:

    -moz-user-select: -moz-none;
    -khtml-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;

If this code is not necessary, consider removing it to optimize your CSS and potentially fix any issues.

Answer №3

It appears that the issue is related to the CSS properties below:

    -moz-user-select: -moz-none;
    -khtml-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;

After removing these from .editObjectsTable * and table.editObjectsTable, the problem was resolved in Internet Explorer. Unfortunately, I do not have Firefox installed on this device to test. However, everything seems to be working fine in Chrome.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Tips for changing a div's visibility with radio buttons in jQuery

$(':radio').change(function(event) { var id = $(this).data('id'); $('#' + id).addClass('none').siblings().removeClass('none'); }); .none { display: none; } <script src="https://ajax.googleapis.com/ ...

Ways to incorporate design elements for transitioning focus between different elements

When focusing on an element, I am using spatialNavigation with the following code: in index.html <script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="dfb5acf2acafbeabb6beb3f2b1bea9b6 ...

Using an if/else statement in a Jade Template to conditionally remove a select option

I'm a beginner with Jade and I've been assigned to add a select option to a webpage. Everything is working well, except for when the drop-down list is empty and the page is refreshed, an empty option element is created. I want to find a way to re ...

Using a variable as the text in a jQuery link

I'm having trouble with a simple variable - I want to use the variable as link text. Here's my code: var ReadMore = myvar; $(this).empty().html(subStr); $(this).append(' <a href="javascript:void(0);" class= ...

jQuery is consistently lagging one step behind when calculating the sum with keypress

I am currently working on developing a calculator that adds up the values entered with each key press. Here is the code snippet I have been using: $('#padd').keypress(function() { var ypoints = "200"; var points = parseInt( $(th ...

The most straightforward method for transforming a C# method into an asynchronous call for a Page/Web Method or jQuery

Looking for a way to call a C# method asynchronously in a web form without triggering a postback? Consider using either a Page Method, Web Method, or jQuery. The method in question handles multiple tasks such as calling other methods, rebuilding a treeview ...

Verify and deselect boxes

Can someone help me with checking and unchecking checkboxes? I'm facing a lot of issues with it. You can find my code snippet here: http://jsfiddle.net/N5Swt/: <input type="checkbox" id="checkbox1" /> <span> Check me! </span> // ...

Tips for incorporating a multiple tag search feature within my image collection using JavaScript?

I am facing a challenge with my image gallery search feature. Currently, users can search for images by typing in the title or tag of an image. However, I need to enhance this functionality to allow for multiple tags to be searched at once. For example, if ...

Ways to serve JSON response following a 400 error code

After a user submits incorrect form details, such as an invalid username or blank email address, I make an Ajax request to my REST API. The response data I receive is structured as follows: HTTP 400 Bad Request Allow: POST, OPTIONS Content-Type: applicati ...

Troubleshooting: Issues with Adding a New Row in Datatables using JQuery

CSS : <div class="datatable-header"> <button type="button" name="add" id="add" class="float-right btn btn-info">Add</button> </div> <div class="table-responsive"> <table ...

Reveal concealed content when a responsive table becomes scrollable on a mobile device

I recently completed a project that was overloaded with tables. I made all the tables responsive, but they still take vertical scroll if they don't fit on certain devices due to their varying widths. For instance, Table A requires vertical scroll o ...

Selecting multiple rows on a Lazily Loaded jQuery Datatable

Currently, I am utilizing a lazy loaded (Deferred) jQuery Datatable and attempting to implement multi-row selection. However, every time I switch to another page of the datatable, the selected rows from the previous page get cleared. // Here's how yo ...

Tips for creating a hover effect on a rounded outline button with a gradient border

What I am looking for: I want the buttons to have rounded corners; The buttons should use linear-gradient, with button A as the border and button B as the background color; When hovering over the buttons, the opacity should change to 0.5. This works fine ...

Div scrolling allows for parallel viewing of PDFs in a side by side arrangement

I have two scrollable elements on my webpage: one positioned on the left side and the other on the right side. The left element is a regular div, while the right element is an object containing an embedded PDF. <object width="100%" height=&quo ...

retrieve Excel document via POST request

I have a scenario where my API endpoint accepts JSON input and returns an Excel file directly instead of providing a link to download the file. How can I use JQuery AJAX to download this file? Here is the backend code snippet: public function postExcel() ...

Issue: JavaScript code is not functional when operating on data obtained through an Ajax

I am experiencing an issue with my JavaScript code (abc.js) that is designed to run on a div element with the class of "one". While the script works perfectly fine on elements already present within the div in the HTML code, it fails to execute on data tha ...

Tips for turning off the auto save password option on browsers for user registration forms

Is there a way to prevent browsers from saving passwords on the add users form? I've tried using autocomplete="off" but it doesn't seem to work for saved passwords. I've searched extensively for a solution but haven't found the right on ...

Having trouble loading select fields using AJAX within Wordpress? Update and find a solution!

UPDATE: I am struggling to iterate through the response object and populate a select field using my ajax function. Although I have tried using a for loop instead of each(), the select field gets populated with "undefined". Any suggestions on how to resolve ...

What is the significance of keyframes in CSS animations at different percentages

I'm facing a challenge with the code below that is intended to make objects float from left to right in the background. However, once they go off-screen, a vertical scroll bar appears despite the overflow-y: hidden attribute added to the class. I atte ...

Tips for loading an external webpage with ajax

I am trying to create a link button that will redirect to another page while displaying the content of that page on the current page. I am working with the bootstrap framework, but unfortunately, the function I've implemented doesn't seem to be w ...