Open damiensan opened 1 year ago
Can you publish a reproduce pls ? That way it will be quicker for me to see what's wrong.
Hello, here it is
When I use the PhoneNumberType
I want to have a input type="tel"
rendered in html not a input type="text"
The input
rendered is a text one.
class AddressType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder->add('phone', PhoneNumberType::class, [
'widget' => PhoneNumberType::WIDGET_COUNTRY_CHOICE
]);
}
}
Render it in Twig
When I look at the PhoneNumberType
, I see
public function buildView(FormView $view, FormInterface $form, array $options): void
{
$view->vars['type'] = 'tel';
$view->vars['widget'] = $options['widget'];
}
which seems fine to me.
It seems that the form_layout.div.html.twig
does not take this option into account.
Thank you.
Hello, any news on this ? Regards
Thank you very much for your issue.
And you're right! It could be better. Not that easy though.
We need to:
You can make a PR for this change if you want.
Hello,
I don't know if this issue relates to Symfony or to the bundle.
When I use
the input rendered by twig is an
input type="text"
instead ofinput type="tel"
Do you know how to fix this, did I miss something ?
Thank you