New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TwigBridge] Allow floats in html5 input type number field #48965
Conversation
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
Can you please have a look a failing tests? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not work with localized numbers, does it? At least from what I see the arrows rendered by the browser will change the format of the rendered values.
Hi @xabbuh , It changes the format to the used locale notation. For me it keeps |
Hi @nicolas-grekas, I fixed the issues in the tests and now it works for 7.2, 7.4 and 8.2 but not for 8.0 and 8.2. Any idea how I can fix it for the other 2? |
src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works well on my side too.
isn't this contradicting the html5 option of the NumberType #\Symfony\Component\Form\Extension\Core\Type\NumberType
public function buildView(FormView $view, FormInterface $form, array $options)
{
if ($options['html5']) {
$view->vars['type'] = 'number';
}
} The default is assuming the same default as the Type is, html5 is false by default, and thus is opted for text instead? |
@esserj , thanks for pointing that out. That option is not needed anymore so I will remove it. |
I'm gonna change this PR and put the steps: any attribute in the html5 option. This way it is fully BC. |
6b7a584
to
0cc23a6
Compare
e96d00b
to
a6f2bcd
Compare
Thank you @wimhendrikx. |
Adding the attribute step: any allows for correct use of floats in number input