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