Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294952

Interactive controls inside preview block in the Layout Builder form should be disabled.

$
0
0

Problem/Motivation

Forms that are displayed in the Layout Builder form are submittable.

This can

  1. Take you away from the layout builder
  2. Create changes to your site.

For example in the node layout override form the comments form is displayed. You can actually create a comment from here. It also may be confusing if you are scrolling up and down the page and you see Save and Preview buttons you might not see the comment for it is attached and then click "Save" and see the message "Comment field is required." field is required(not speaking from personal experience or anything 😜).

The search form could also be placed which will take you away from the page.

With contrib modules you would have any more fields that might expose forms. Inline Entity Form and Webform for example.

Additionally but related are there could be other blocks/field that expose links that take you away from the page. Or certain links like for example links from the Flag module might actually save data("Bookmark this") from the rendered blocks.

Submitting these forms and clicking the links could be accidental click or the user might get confused and think they are looking at the entity view page.

Proposed resolution

Similar to Settings Tray Edit mode forms and links on Layout Builder preview blocks should be inoperable. This effects both the default and override layout forms.

Possible ways to do this:
Via Javascript see: core/modules/settings_tray/js/settings_tray.es6.js
When rendering a block preview we could set #disabled on all form elements and links.

Remaining tasks

  1. Confirm we want to disable forms and links
  2. write failing tests
  3. Write fix
  4. review
  5. 🎉

User interface changes

All links and forms in layout builder form will be disabled.

API changes

None

Data model changes

None


Viewing all articles
Browse latest Browse all 294952

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>