3 namespace Drupal\entity_browser\Plugin\EntityBrowser\SelectionDisplay;
5 use Drupal\Core\Form\FormStateInterface;
6 use Drupal\entity_browser\SelectionDisplayBase;
9 * Does not show current selection and immediately delivers selected entities.
11 * @EntityBrowserSelectionDisplay(
13 * label = @Translation("No selection display"),
14 * description = @Translation("Skips the current selection display and immediately delivers the entities selected."),
15 * acceptPreselection = FALSE,
19 class NoDisplay extends SelectionDisplayBase {
24 public function getForm(array &$original_form, FormStateInterface $form_state) {
31 public function submit(array &$form, FormStateInterface $form_state) {
32 // Only finish selection if the form was submitted using main submit
33 // element. This allows widgets to build multi-step workflows.
34 if (!empty($form_state->getTriggeringElement()['#eb_widget_main_submit'])) {
35 $this->selectionDone($form_state);