feat: let the remaining textareas grow with their content

This commit is contained in:
fromme committed 2026-10-20 14:04:55 +02:00
1 parent 2de985b009
commit 8c53676133
11 files changed
+29 -65

No files matched your search

+4 -9
View File
@@ -5,7 +5,6 @@ namespace App\Form;
use App\Entity\Feedback; use App\Entity\Feedback;
use App\Entity\FeedbackSet; use App\Entity\FeedbackSet;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormInterface;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -24,20 +23,16 @@ abstract class AbstractFeedbackType extends AbstractType
'label' => false, 'label' => false,
'feedback_set' => $feedbackSet, 'feedback_set' => $feedbackSet,
]) ])
->add('comment', TextareaType::class, [ ->add('comment', AutosizeTextareaType::class, [
'label' => 'Kommentar (öffentlich)', 'label' => 'Kommentar (öffentlich)',
'required' => false, 'required' => false,
'attr' => [ 'min_rows' => 5,
'rows' => 5,
],
'help' => 'Bitte formuliere deinen Kommentar so, dass er an das Team weitergegeben werden kann', 'help' => 'Bitte formuliere deinen Kommentar so, dass er an das Team weitergegeben werden kann',
]) ])
->add('commentInternal', TextareaType::class, [ ->add('commentInternal', AutosizeTextareaType::class, [
'label' => 'Kommentar (intern)', 'label' => 'Kommentar (intern)',
'required' => false, 'required' => false,
'attr' => [ 'min_rows' => 5,
'rows' => 5,
],
]) ])
; ;
} }
+2 -5
View File
@@ -7,7 +7,6 @@ use App\Model\ApplicationStatusDto;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -24,12 +23,10 @@ class ApplicationStatusType extends AbstractType
'neu' => Application::STATUS_NEW, 'neu' => Application::STATUS_NEW,
], ],
]) ])
->add('comment', TextareaType::class, [ ->add('comment', AutosizeTextareaType::class, [
'label' => 'Kommentar/Begründung', 'label' => 'Kommentar/Begründung',
'required' => false, 'required' => false,
'attr' => [ 'min_rows' => 3,
'rows' => 3,
],
]) ])
->add('commentVisible', CheckboxType::class, [ ->add('commentVisible', CheckboxType::class, [
'label' => 'Kommentar/Begründung sichtbar für Teamer:in', 'label' => 'Kommentar/Begründung sichtbar für Teamer:in',
+4 -9
View File
@@ -15,7 +15,6 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType; use Symfony\Component\Form\Extension\Core\Type\IntegerType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents; use Symfony\Component\Form\FormEvents;
@@ -73,23 +72,19 @@ class AssignmentType extends AbstractType
->where('job_profile.deletedAt IS NULL'); ->where('job_profile.deletedAt IS NULL');
}, },
]) ])
->add('jobProfileInfo', TextareaType::class, [ ->add('jobProfileInfo', AutosizeTextareaType::class, [
'label' => 'Zusatzinfos', 'label' => 'Zusatzinfos',
'required' => false, 'required' => false,
'attr' => [ 'min_rows' => 3,
'rows' => 3,
],
]) ])
// ->add('pickupDate', DatepickerType::class, [ // ->add('pickupDate', DatepickerType::class, [
// 'label' => 'abweichender Zustieg bei Busbegleitung', // 'label' => 'abweichender Zustieg bei Busbegleitung',
// 'required' => false, // 'required' => false,
// ]) // ])
->add('benefits', TextareaType::class, [ ->add('benefits', AutosizeTextareaType::class, [
'label' => 'Benefits', 'label' => 'Benefits',
'required' => false, 'required' => false,
'attr' => [ 'min_rows' => 5,
'rows' => 5,
],
]) ])
->add('fees', EntityType::class, [ ->add('fees', EntityType::class, [
'label' => 'Honorar(e)', 'label' => 'Honorar(e)',
+3 -6
View File
@@ -6,7 +6,6 @@ use App\Entity\Upload;
use App\Model\DocumentCheckDto; use App\Model\DocumentCheckDto;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents; use Symfony\Component\Form\FormEvents;
@@ -21,12 +20,10 @@ class DocumentCheckType extends AbstractType
'label' => 'neuer Status', 'label' => 'neuer Status',
'choices' => $options['status_choices'][$options['document_type']], 'choices' => $options['status_choices'][$options['document_type']],
]) ])
->add('comment', TextareaType::class, [ ->add('comment', AutosizeTextareaType::class, [
'label' => 'Kommentar/Begründung', 'label' => 'Kommentar/Begründung',
'required' => false, 'required' => false,
'attr' => [ 'min_rows' => 3,
'rows' => 3,
],
]) ])
->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
/** @var DocumentCheckDto $data */ /** @var DocumentCheckDto $data */
@@ -34,7 +31,7 @@ class DocumentCheckType extends AbstractType
$upload = $data->getUpload(); $upload = $data->getUpload();
if (Upload::TYPE_INVOICE === $upload->getType()) { if (Upload::TYPE_INVOICE === $upload->getType()) {
$event->getForm()->add('specialAgreements', TextareaType::class, [ $event->getForm()->add('specialAgreements', AutosizeTextareaType::class, [
'label' => 'zusätzliche Absprache', 'label' => 'zusätzliche Absprache',
'required' => false, 'required' => false,
]); ]);
+2 -5
View File
@@ -6,7 +6,6 @@ use App\Entity\Upload;
use App\Model\DriverLicenseCheckDto; use App\Model\DriverLicenseCheckDto;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -23,12 +22,10 @@ class DriverLicenseCheckType extends AbstractType
'abgelehnt' => Upload::STATUS_REJECTED, 'abgelehnt' => Upload::STATUS_REJECTED,
], ],
]) ])
->add('comment', TextareaType::class, [ ->add('comment', AutosizeTextareaType::class, [
'label' => 'Kommentar/Begründung', 'label' => 'Kommentar/Begründung',
'required' => false, 'required' => false,
'attr' => [ 'min_rows' => 3,
'rows' => 3,
],
]) ])
; ;
} }
+2 -2
View File
@@ -4,7 +4,6 @@ namespace App\Form;
use App\Entity\Faq; use App\Entity\Faq;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -17,8 +16,9 @@ class FaqType extends AbstractType
->add('question', TextType::class, [ ->add('question', TextType::class, [
'label' => 'Frage', 'label' => 'Frage',
]) ])
->add('answer', TextareaType::class, [ ->add('answer', AutosizeTextareaType::class, [
'label' => 'Antwort', 'label' => 'Antwort',
'min_rows' => 5,
]) ])
; ;
} }
+4 -9
View File
@@ -4,7 +4,6 @@ namespace App\Form;
use App\Entity\Feedback; use App\Entity\Feedback;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -13,19 +12,15 @@ class FeedbackApproveType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options): void public function buildForm(FormBuilderInterface $builder, array $options): void
{ {
$builder $builder
->add('comment', TextareaType::class, [ ->add('comment', AutosizeTextareaType::class, [
'label' => 'Kommentar (öffentlich)', 'label' => 'Kommentar (öffentlich)',
'required' => false, 'required' => false,
'attr' => [ 'min_rows' => 5,
'rows' => 5,
],
]) ])
->add('commentInternal', TextareaType::class, [ ->add('commentInternal', AutosizeTextareaType::class, [
'label' => 'Kommentar (intern)', 'label' => 'Kommentar (intern)',
'required' => false, 'required' => false,
'attr' => [ 'min_rows' => 5,
'rows' => 5,
],
]) ])
; ;
} }
+2 -5
View File
@@ -5,7 +5,6 @@ namespace App\Form;
use App\Entity\News; use App\Entity\News;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -22,11 +21,9 @@ class NewsType extends AbstractType
'label.news.status.2' => News::STATUS_IMPORTANT, 'label.news.status.2' => News::STATUS_IMPORTANT,
], ],
]) ])
->add('message', TextareaType::class, [ ->add('message', AutosizeTextareaType::class, [
'label' => 'Nachricht', 'label' => 'Nachricht',
'attr' => [ 'min_rows' => 5,
'rows' => 5,
],
]) ])
; ;
} }
+2 -5
View File
@@ -7,7 +7,6 @@ use App\Service\Common\PickupOptions;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents; use Symfony\Component\Form\FormEvents;
@@ -19,12 +18,10 @@ class TeamerApplicationType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options): void public function buildForm(FormBuilderInterface $builder, array $options): void
{ {
$builder $builder
->add('requests', TextareaType::class, [ ->add('requests', AutosizeTextareaType::class, [
'label' => 'Wünsche', 'label' => 'Wünsche',
'required' => false, 'required' => false,
'attr' => [ 'min_rows' => 3,
'rows' => 3,
],
]) ])
->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
/** @var Application $application */ /** @var Application $application */
+2 -5
View File
@@ -7,7 +7,6 @@ use App\Entity\Teamer;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;
use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Translation\TranslatableMessage; use Symfony\Component\Translation\TranslatableMessage;
@@ -59,12 +58,10 @@ class TeamerJobProfileType extends AbstractType
'expanded' => true, 'expanded' => true,
'multiple' => true, 'multiple' => true,
]) ])
->add('remarks', TextareaType::class, [ ->add('remarks', AutosizeTextareaType::class, [
'label' => 'Wünsche/Anmerkungen', 'label' => 'Wünsche/Anmerkungen',
'required' => false, 'required' => false,
'attr' => [ 'min_rows' => 3,
'rows' => 3,
],
]) ])
; ;
} }
+2 -5
View File
@@ -6,7 +6,6 @@ use App\Enum\WorkMonthStatus;
use App\Model\WorkMonthReviewDto; use App\Model\WorkMonthReviewDto;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -27,12 +26,10 @@ class WorkMonthReviewType extends AbstractType
], ],
'choice_value' => static fn (?WorkMonthStatus $status) => $status?->value, 'choice_value' => static fn (?WorkMonthStatus $status) => $status?->value,
]) ])
->add('comment', TextareaType::class, [ ->add('comment', AutosizeTextareaType::class, [
'label' => 'Kommentar/Begründung', 'label' => 'Kommentar/Begründung',
'required' => false, 'required' => false,
'attr' => [ 'min_rows' => 3,
'rows' => 3,
],
]) ])
; ;
} }