This commit is contained in:
parent
6314732d74
commit
d933fa136f
@ -12,7 +12,6 @@ CHANGELOG
|
||||
* Added a `ChoiceList` facade to leverage explicit choice list caching based on options
|
||||
* Added an `AbstractChoiceLoader` to simplify implementations and handle global optimizations
|
||||
* The `view_timezone` option defaults to the `model_timezone` if no `reference_date` is configured.
|
||||
* Added default `inputmode` attribute to Search, Email and Tel form types.
|
||||
* Implementing the `FormConfigInterface` without implementing the `getIsEmptyCallback()` method
|
||||
is deprecated. The method will be added to the interface in 6.0.
|
||||
* Implementing the `FormConfigBuilderInterface` without implementing the `setIsEmptyCallback()` method
|
||||
|
@ -12,8 +12,6 @@
|
||||
namespace Symfony\Component\Form\Extension\Core\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\FormView;
|
||||
|
||||
class EmailType extends AbstractType
|
||||
{
|
||||
@ -25,14 +23,6 @@ class EmailType extends AbstractType
|
||||
return TextType::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildView(FormView $view, FormInterface $form, array $options)
|
||||
{
|
||||
$view->vars['attr']['inputmode'] = $options['attr']['inputmode'] ?? 'email';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -12,8 +12,6 @@
|
||||
namespace Symfony\Component\Form\Extension\Core\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\FormView;
|
||||
|
||||
class SearchType extends AbstractType
|
||||
{
|
||||
@ -25,14 +23,6 @@ class SearchType extends AbstractType
|
||||
return TextType::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildView(FormView $view, FormInterface $form, array $options)
|
||||
{
|
||||
$view->vars['attr']['inputmode'] = $options['attr']['inputmode'] ?? 'search';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -12,8 +12,6 @@
|
||||
namespace Symfony\Component\Form\Extension\Core\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\Form\FormView;
|
||||
|
||||
class TelType extends AbstractType
|
||||
{
|
||||
@ -25,14 +23,6 @@ class TelType extends AbstractType
|
||||
return TextType::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildView(FormView $view, FormInterface $form, array $options)
|
||||
{
|
||||
$view->vars['attr']['inputmode'] = $options['attr']['inputmode'] ?? 'tel';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Form\Tests\Extension\Core\Type;
|
||||
|
||||
class EmailTypeTest extends BaseTypeTest
|
||||
{
|
||||
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\EmailType';
|
||||
|
||||
public function testDefaultInputmode()
|
||||
{
|
||||
$form = $this->factory->create(static::TESTED_TYPE);
|
||||
|
||||
$this->assertSame('email', $form->createView()->vars['attr']['inputmode']);
|
||||
}
|
||||
|
||||
public function testOverwrittenInputmode()
|
||||
{
|
||||
$form = $this->factory->create(static::TESTED_TYPE, null, ['attr' => ['inputmode' => 'text']]);
|
||||
|
||||
$this->assertSame('text', $form->createView()->vars['attr']['inputmode']);
|
||||
}
|
||||
|
||||
public function testSubmitNull($expected = null, $norm = null, $view = null)
|
||||
{
|
||||
parent::testSubmitNull($expected, $norm, '');
|
||||
}
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Form\Tests\Extension\Core\Type;
|
||||
|
||||
class SearchTypeTest extends BaseTypeTest
|
||||
{
|
||||
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\SearchType';
|
||||
|
||||
public function testDefaultInputmode()
|
||||
{
|
||||
$form = $this->factory->create(static::TESTED_TYPE);
|
||||
|
||||
$this->assertSame('search', $form->createView()->vars['attr']['inputmode']);
|
||||
}
|
||||
|
||||
public function testOverwrittenInputmode()
|
||||
{
|
||||
$form = $this->factory->create(static::TESTED_TYPE, null, ['attr' => ['inputmode' => 'text']]);
|
||||
|
||||
$this->assertSame('text', $form->createView()->vars['attr']['inputmode']);
|
||||
}
|
||||
|
||||
public function testSubmitNull($expected = null, $norm = null, $view = null)
|
||||
{
|
||||
parent::testSubmitNull($expected, $norm, '');
|
||||
}
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Form\Tests\Extension\Core\Type;
|
||||
|
||||
class TelTypeTest extends BaseTypeTest
|
||||
{
|
||||
const TESTED_TYPE = 'Symfony\Component\Form\Extension\Core\Type\TelType';
|
||||
|
||||
public function testDefaultInputmode()
|
||||
{
|
||||
$form = $this->factory->create(static::TESTED_TYPE);
|
||||
|
||||
$this->assertSame('tel', $form->createView()->vars['attr']['inputmode']);
|
||||
}
|
||||
|
||||
public function testOverwrittenInputmode()
|
||||
{
|
||||
$form = $this->factory->create(static::TESTED_TYPE, null, ['attr' => ['inputmode' => 'text']]);
|
||||
|
||||
$this->assertSame('text', $form->createView()->vars['attr']['inputmode']);
|
||||
}
|
||||
|
||||
public function testSubmitNull($expected = null, $norm = null, $view = null)
|
||||
{
|
||||
parent::testSubmitNull($expected, $norm, '');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user