Prevent drag and drop operations on field ui whilst ajax is in progress

Created on 2 June 2016, over 8 years ago
Updated 8 May 2023, over 1 year ago

Problem/Motivation

With a large number of fields on the Manage Display page and when moving fields to the Disabled section sometimes it jumps to the bottom and changes are lost.

Since each of these operations requires a backend ajax call there is a potential that if the user proceeds to select and move multiple fields that their work will be overwritten by the ajax response.

Steps to reproduce

  1. Use a slow connection. This will not be obvious on a typical local dev setup.
  2. Create a large quantity of fields (over 20)
  3. Edit the default managed display and proceed to move multiple fields into the Disabled grouping

Proposed resolution

N/A

Remaining tasks

N/A

User interface changes

  1. Would it possible to include a button to move all fields to the disabled section, rather than piecemeal. There will be many sites that have more than a few fields. A normal site builder with multiple fields would have to move all fields individually (in our case it's 20+) by hand, while waiting to make sure that the ajax callback is completed -- which isn't always obvious to a normal site builder. A dev might be able to look at the chrome dev tools network tab but that is out of the question for a normal site builder.
  2. For moving fields between Groupings 'Field', 'Disabled' don't require an ajax call. When adjusting 'Labels' and 'Format' it makes sense to require the ajax call for obvious reasons. Question: I wonder how fieldgroups and other other custom functionality would be affected by this.
  3. Disable drag and drip while Ajax is running

API changes

N/A

Data model changes

N/A

Release notes snippet

Original report by generalconsensus

I've attached gif videos showing our basic demo site running with multiple fields in which you can clearly see the ajax call and the 'lag behind' of the callback and the ux issue.

Feature request
Status

Needs work

Version

10.1

Component
Field 

Last updated about 13 hours ago

Created by

🇺🇸United States generalconsensus

Live updates comments and jobs are added and updated live.
  • Field UX

    Usability improvements related to the Field UI

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States Amber Himes Matz Portland, OR USA

    Thank you for the report and for providing steps to reproduce and even a gif of the problem in action! We triaged this as part of the Bug Smash Initiative. Because there's been no activity for many years, this issue needs to be re-verified on a currently supported version of Drupal with some manual testing.

  • 🇳🇿New Zealand quietone

    Further discussion and testing shows that this is reproducible when the connection is slow. For example, I was able to reproduce this with simplytestme but not my local ddev environment. We (Amber Himes Matz, larowlan and myself) agree that this can be a feature request. I am updating the issue meta and summary accordingly.

  • 🇳🇿New Zealand quietone

    Improve the problem/motivation.

  • First commit to issue fork.
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    Custom Commands Failed
  • @bnjmnm opened merge request.
  • Status changed to Needs review over 1 year ago
  • 🇺🇸United States bnjmnm Ann Arbor, MI

    This disables drag handles while Ajax is in progress. Maybe there's something more elegant like queueing the drags but this approach will work.

    This is probably better categorized as "needs architectural review" - not every theme is accounted for among other things. Test this in Claro. There should be some eyes on this before the full gate-appeasing MR is fleshed out.

    There's no test coverage, but since this is timing related I'm not sure if that's an option. Perhaps hold_test_response could be used?

  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States smustgrave

    Seems to have a build error.

    Will this require tests?

Production build 0.71.5 2024