Skip to content

Commit 3a15b03

Browse files
committed
ignore the pattern attribute for textareas
1 parent a8fe9bb commit 3a15b03

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Extension/Core/Type/TextareaType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class TextareaType extends AbstractType
2323
public function buildView(FormView $view, FormInterface $form, array $options)
2424
{
2525
$view->vars['pattern'] = null;
26+
unset($view->vars['attr']['pattern']);
2627
}
2728

2829
/**

Tests/AbstractLayoutTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2068,7 +2068,7 @@ public function testTextarea()
20682068
$this->assertWidgetMatchesXpath($form->createView(), [],
20692069
'/textarea
20702070
[@name="name"]
2071-
[@pattern="foo"]
2071+
[not(@pattern)]
20722072
[.="foo&bar"]
20732073
'
20742074
);

0 commit comments

Comments
 (0)