ignore the pattern attribute for textareas

This commit is contained in:
Christian Flothmann 2020-11-17 17:13:30 +01:00
parent c72f85333a
commit e7698e7434
4 changed files with 4 additions and 3 deletions

View File

@ -2379,7 +2379,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
$this->assertWidgetMatchesXpath($form->createView(), ['attr' => ['class' => 'my&class']],
'/textarea
[@name="name"]
[@pattern="foo"]
[not(@pattern)]
[@class="my&class form-control"]
[.="foo&bar"]
'

View File

@ -26,7 +26,7 @@
"symfony/dependency-injection": "^3.4|^4.0|^5.0",
"symfony/error-handler": "^4.4|^5.0",
"symfony/finder": "^3.4|^4.0|^5.0",
"symfony/form": "^4.3.5",
"symfony/form": "^4.4.17",
"symfony/http-foundation": "^4.3|^5.0",
"symfony/http-kernel": "^4.4",
"symfony/mime": "^4.3|^5.0",

View File

@ -23,6 +23,7 @@ class TextareaType extends AbstractType
public function buildView(FormView $view, FormInterface $form, array $options)
{
$view->vars['pattern'] = null;
unset($view->vars['attr']['pattern']);
}
/**

View File

@ -2068,7 +2068,7 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase
$this->assertWidgetMatchesXpath($form->createView(), [],
'/textarea
[@name="name"]
[@pattern="foo"]
[not(@pattern)]
[.="foo&bar"]
'
);