Allow forms to easily determine whether they are shown in a modal

Created on 2 February 2016, over 8 years ago
Updated 19 June 2023, about 1 year ago

Forms that are intended to be shown in a modal dialog also have a fallback for when javascript is disabled. For example, a "Cancel" button should be shown on the fallback, but not when displayed in a modal.

The information whether a form is displayed in a modal can be found on the request, but this is not very DX friendly and hard to discover:

  $this->getRequest()->query->get(MainContentViewSubscriber::WRAPPER_FORMAT) === 'drupal_modal';
✨ Feature request
Status

Needs work

Version

11.0 πŸ”₯

Component
FormΒ  β†’

Last updated 1 minute ago

Created by

πŸ‡§πŸ‡¬Bulgaria pfrenssen Sofia

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

Production build 0.71.5 2024