Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a5abbd1

Browse filesBrowse files
committed
Add inputmode attribute on some FormType
1 parent 5c37c1f commit a5abbd1
Copy full SHA for a5abbd1

File tree

4 files changed

+12
-0
lines changed
Filter options

4 files changed

+12
-0
lines changed

‎src/Symfony/Component/Form/Extension/Core/Type/EmailType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/EmailType.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
namespace Symfony\Component\Form\Extension\Core\Type;
1313

1414
use Symfony\Component\Form\AbstractType;
15+
use Symfony\Component\Form\FormInterface;
16+
use Symfony\Component\Form\FormView;
1517
use Symfony\Component\OptionsResolver\OptionsResolver;
1618

1719
class EmailType extends AbstractType

‎src/Symfony/Component/Form/Extension/Core/Type/NumberType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/NumberType.php
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ public function buildView(FormView $view, FormInterface $form, array $options)
4848
if ($options['html5']) {
4949
$view->vars['type'] = 'number';
5050
}
51+
52+
if (0 === $options['scale']) {
53+
$view->vars['attr']['inputmode'] = 'numeric';
54+
} else {
55+
$view->vars['attr']['inputmode'] = 'decimal';
56+
}
5157
}
5258

5359
/**

‎src/Symfony/Component/Form/Extension/Core/Type/SearchType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/SearchType.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
namespace Symfony\Component\Form\Extension\Core\Type;
1313

1414
use Symfony\Component\Form\AbstractType;
15+
use Symfony\Component\Form\FormInterface;
16+
use Symfony\Component\Form\FormView;
1517
use Symfony\Component\OptionsResolver\OptionsResolver;
1618

1719
class SearchType extends AbstractType

‎src/Symfony/Component/Form/Extension/Core/Type/TelType.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/Type/TelType.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
namespace Symfony\Component\Form\Extension\Core\Type;
1313

1414
use Symfony\Component\Form\AbstractType;
15+
use Symfony\Component\Form\FormInterface;
16+
use Symfony\Component\Form\FormView;
1517
use Symfony\Component\OptionsResolver\OptionsResolver;
1618

1719
class TelType extends AbstractType

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.