• I maintain the WP Store Locator plugin, and have had someone report that the main content block is draggable in Gutenberg and it can be moved into the sidebar. But once it’s there it can’t be dragged back.

    It shouldn’t be draggable in the first place, but if that can’t be disabled, is there a way to make it least possible for users to drag it back? ( searching for draggable and Gutenberg on Google wasn’t that helpful ).

    This is what it normally looks, and this is the messy end result if they drag it into the sidebar.

    Anyone who can point me in the right direction what I should look at to prevent this from happening, or make it possible so that users can drag it back? The store details block is a normal meta box itself.

    • This topic was modified 3 years, 6 months ago by Tijmen Smit.
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Ah, that happened to me with some other meta box I was messing with. It’s reasonable to have boxes be positionable, though moving some really doesn’t make sense. They should at least be able to be moved back. I assume you mean a meta box. I don’t see how editor blocks can be dragged at all. It’s been a while since this happened to me. IIRC I fixed it by removing user meta related to repositioned meta boxes. Perhaps you can prevent this meta update from being saved through the “update_user_metadata” filter?

    Refer to the related function’s source code for specifics on filter use:
    https://developer.www.ads-software.com/reference/functions/update_metadata/#source
    (untested concept)

    I don’t recall the meta key used, sorry. You should be able to identify it (through phpMyAdmin) for a newly created user after they drag your box. New user since they’ll have little meta data to sift through.

    This seems like a bug in Gutenberg itself. You should consider raising an issue at their github project (free registration required)
    https://github.com/WordPress/gutenberg/issues

Viewing 1 replies (of 1 total)
  • The topic ‘Prevent main content block from being draggable into sidebar’ is closed to new replies.