Add block restriction validation at start of drag

Created on 24 August 2022, almost 2 years ago
Updated 16 May 2024, about 1 month ago

Problem/Motivation

Currently the editor has to wait until the block is dropped before being alerted to restrictions. This user experience is less than ideal and leaves the user guessing as to where they can safely move a block.

Proposed resolution

Create a controller to handle immediate validation instead of waiting for the block move end. Use ajax to update the layout without requiring the entire layout to be rebuilt.

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Needs review

Version

3.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States michaellander

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

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

  • πŸ‡ΊπŸ‡ΈUnited States michaellander
  • Status changed to Needs work 6 months ago
  • Reviewing in Drupal 10, I'm unable to reorder any blocks in layout via dragging. I can still drag the element, but the yellow "destination" preview never moves from the original position. This occurs just by having the module enabled, even if no restrictions have been applied.

    I am able to reorder blocks if I select the "move" option on an individual block within the layout. Reordering itself seems unaffected - the drag and drop interface seems to be where the failure occurs.

    No dblog or console errors were generated.

  • Status changed to Needs review 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States michaellander

    Hi @bjc2265, I've tested this again and it's still working for me. Have you seen any error messages in console or drupal logs? I will say that if you have a lot of debugging turned on, or caching turned off, it may be a little slow(as with all things layout builder). Right now the default behavior is to prevent dropping anywhere until validation is done. I could always change it to allow dropping anywhere until validation is finished, which would fall back to the currently build-in validation. With normal cache settings enabled, it has been pretty seamless for me but I want to make sure that's true for others.

  • πŸ‡ΊπŸ‡ΈUnited States michaellander

    I really think this would be a nice addition to this module, and I would be happy to make it something that is an optional setting if we think it's too big of a change to introduce by default. Would love some feedback from a maintainer. Thank you!

  • πŸ‡ΊπŸ‡ΈUnited States brayn7 Lexington, Ky

    brayn7 β†’ changed the visibility of the branch 3305640-add-block-restriction to hidden.

  • πŸ‡ΊπŸ‡ΈUnited States brayn7 Lexington, Ky

    brayn7 β†’ changed the visibility of the branch 3305640-add-block-restriction to active.

  • πŸ‡ΊπŸ‡ΈUnited States mark_fullmer Tucson
Production build 0.69.0 2024