[Form] Automatically add step attribute to HTML5 time widgets to display seconds if needed #10777

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
4 participants
@tucksaun
Contributor

tucksaun commented Apr 24, 2014

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #9976, #10203
License MIT
Doc PR none

Same issue as #9976 and #10203: when you add a time field to a form with options single_text (so HTML5) and with_seconds, the generated input does not contain the step attribute, therefore the browser does not show them, leading to an error at the submit because of an invalid format.

Compared to #9976/#10203:

  • Unit testable
  • Available directly in the component
  • Available in other templating format than twig
  • Still able to customise the step attribute by hand
@Tobion

This comment has been minimized.

Show comment
Hide comment
@Tobion

Tobion May 16, 2014

Member

👍

Member

Tobion commented May 16, 2014

👍

@fabpot

This comment has been minimized.

Show comment
Hide comment
@fabpot

fabpot May 16, 2014

Member

Thank you @tucksaun.

Member

fabpot commented May 16, 2014

Thank you @tucksaun.

fabpot added a commit that referenced this pull request May 16, 2014

bug #10777 [Form] Automatically add step attribute to HTML5 time widg…
…ets to display seconds if needed (tucksaun)

This PR was squashed before being merged into the 2.3 branch (closes #10777).

Discussion
----------

[Form] Automatically add step attribute to HTML5 time widgets to display seconds if needed

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #9976, #10203
| License       | MIT
| Doc PR        | none

Same issue as #9976 and #10203: when you add a `time` field to a form with options `single_text` (so HTML5) and `with_seconds`, the generated input does not contain the `step` attribute, therefore the browser does not show them, leading to an error at the submit because of an invalid format.

Compared to #9976/#10203:
* Unit testable
* Available directly in the component
* Available in other templating format than twig
* Still able to customise the step attribute by hand

Commits
-------

a379298 [Form] Automatically add step attribute to HTML5 time widgets to display seconds if needed

@fabpot fabpot closed this May 16, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment