diff --git a/src/Form/Type/TestType.php b/src/Form/Type/TestType.php new file mode 100644 index 000000000..8eb6d5389 --- /dev/null +++ b/src/Form/Type/TestType.php @@ -0,0 +1,21 @@ +add( + 'barcode', + TextType::class, + ) + ; + } +} diff --git a/src/Twig/Components/TestComponent.php b/src/Twig/Components/TestComponent.php new file mode 100644 index 000000000..70cde51ca --- /dev/null +++ b/src/Twig/Components/TestComponent.php @@ -0,0 +1,37 @@ +submitForm(); + $this->resetForm(); + } + + protected function instantiateForm(): FormInterface + { + return $this->createForm(TestType::class); + } + + private function getDataModelValue(): ?string + { + return 'norender|*'; + } +} diff --git a/templates/components/test.html.twig b/templates/components/test.html.twig new file mode 100644 index 000000000..287eafdae --- /dev/null +++ b/templates/components/test.html.twig @@ -0,0 +1,21 @@ +
+ + This input field does not get a reset after submitted by hitting the enter key. + + {{ form_start(form, { + attr: { + 'data-action': 'live#action:prevent', + 'data-live-action-param': 'submit', + } + }) }} + {{ form_row(form.barcode) }} + + {{ form_end(form) }} + +
+ loading +
+
\ No newline at end of file diff --git a/templates/default/homepage.html.twig b/templates/default/homepage.html.twig index ca273be79..83bb2725f 100644 --- a/templates/default/homepage.html.twig +++ b/templates/default/homepage.html.twig @@ -1,47 +1,7 @@ {% extends 'base.html.twig' %} -{% block body_id 'homepage' %} - -{# - the homepage is a special page which displays neither a header nor a footer. - this is done with the 'trick' of defining empty Twig blocks without any content -#} -{% block header %}{% endblock %} -{% block footer %}{% endblock %} {% block body %} - - -
-
-
-

- {{ 'help.browse_app'|trans|raw }} -

-

- - {{ 'action.browse_app'|trans }} - -

-
-
+ {{ component('TestComponent') }} -
-
-

- {{ 'help.browse_admin'|trans|raw }} -

-

- - {{ 'action.browse_admin'|trans }} - -

-
-
-
{% endblock %}