Skip to content

Drag and drop with Grid field creates bogus content #14920

Description

@leewillis77

Bug description

When re-ordering elements in a Grid field, if you happen to focus the whole fieldset (by clicking and then try and drag a row you end up with a copy of the content (but not the field) dragged into your content as a table. This is confusing for the user and occasionally seems to break any subsequent re-ordering of fields (the fields look like they've reordered but the order is not persisted on save).

Screen recording of the issue in action (it's difficult to explain clearly!):
https://github.com/user-attachments/assets/ea580825-6ac7-44f4-ac6b-7fb2904e29cb

Notes:
00:00 to 00:07 - drag and drop working correctly
00:08 - user clicks on the fieldset area notice how the fieldset acquires a blue border. In this screenshot this is a little contrived, but when working with longer fieldsets on small screens it's easy to do this when scrolling and navigating around
00:10 to 00:12 - user attempts to drag to reorder an item, instead the whole fieldset is dragged and a copy of the content is dumped into the entity as a table

How to reproduce

The fieldset used in the demo above is attached.

service_feature_list.yaml

Logs

Environment

Environment
Laravel Version: 12.62.0
PHP Version: 8.3.31
Composer Version: 2.10.0
Environment: local
Debug Mode: ENABLED
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Storage
public/storage: NOT LINKED

Statamic
Addons: 0
License Key: Not set
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 6.24.0 Solo

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions