Skip to content

Improved Bootstrap form theme for hidden fields #17568

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

Closed
wants to merge 6 commits into from

Conversation

javiereguiluz
Copy link
Member

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #16925
License MIT
Doc PR -

@satanasdiabolo
Copy link

The widget choice_widget_collapsed also need to be modified to remove the form-control class.
Maybe I was unclear about this in my comment on the ticket.

@javiereguiluz
Copy link
Member Author

@satanasdiabolo I've removed the form-control class from <select> elements too, as Bootstrap does. But beware that this change can severely change the look of your application. This is what happened to one of my applications:

Before

select_before

After

select_after

@michaelPf85
Copy link

@javiereguiluz You shouldn't remove it from the select. In the issue I gave the list of "input" types that were intended to be used with the "form-control" class but I forgot to cite "select" and "textarea" as they seemed "off topic", I might have been wrong.

// Common form controls
//
// Shared size and type resets for form controls. Apply `.form-control` to any
// of the following form controls:
//
// select
// textarea
// input[type="text"]
// input[type="password"]
// input[type="datetime"]
// input[type="datetime-local"]
// input[type="date"]
// input[type="month"]
// input[type="time"]
// input[type="week"]
// input[type="number"]
// input[type="email"]
// input[type="url"]
// input[type="search"]
// input[type="tel"]
// input[type="color"]

.form-control {

@javiereguiluz
Copy link
Member Author

@michaelPf85 thanks. I've reverted the last change.

javiereguiluz added a commit to EasyCorp/EasyAdminBundle that referenced this pull request Jan 28, 2016
…iluz)

This PR was merged into the master branch.

Discussion
----------

Improved Bootstrap form theme for hidden fields

Needed to stay in sync with Symfony's Bootstrap form theme. See symfony/symfony#17568

Commits
-------

b2a1ca7 Improved Bootstrap form theme for hidden fields
@javiereguiluz
Copy link
Member Author

I don't understand the failed tests. They refer to the vendor/ dir inside the Twig Bridge:

/home/travis/build/symfony/symfony/src/Symfony/Bridge/Twig/vendor/symfony/form/Tests/AbstractLayoutTest.php:84
/home/travis/build/symfony/symfony/src/Symfony/Bridge/Twig/vendor/symfony/form/Tests/AbstractLayoutTest.php:106
/home/travis/build/symfony/symfony/src/Symfony/Bridge/Twig/vendor/symfony/form/Tests/AbstractBootstrap3LayoutTest.php:697

Can we ignore these fails or should we do something else? Thanks!

@HeahDude
Copy link
Contributor

It seems like 02b06e5 is not committed in those failing tests, see this line [@class="form-control"] is still there.

@fabpot
Copy link
Member

fabpot commented Feb 16, 2016

@javiereguiluz Can you finish this one and fix the tests?

@HeahDude
Copy link
Contributor

I've got the same problem in my tests of #17609, could something go wrong with travis ?

@xabbuh
Copy link
Member

xabbuh commented Feb 17, 2016

Looks like you need to bump requirements of the Form component in the TwigBridge or make it flexible enough to provide output that satisfied all versions.

@javiereguiluz
Copy link
Member Author

@xabbuh thanks for the hint. Do you have any proposal for the new requirements to use? Thanks!

@xabbuh
Copy link
Member

xabbuh commented Feb 17, 2016

@javiereguiluz I think changing the version constraint from ~2.7,>=2.7.8 to ~2.7,>=2.7.10 should make the low dependency tests pass.

@javiereguiluz
Copy link
Member Author

@xabbuh thank you! I've changed it. Let's see if tests go green again.

@xabbuh
Copy link
Member

xabbuh commented Feb 17, 2016

@javiereguiluz sorry, I forgot about 2.8, please try ~2.7.10|~2.8.3

@fabpot
Copy link
Member

fabpot commented Feb 29, 2016

Tests are still red.

@xabbuh
Copy link
Member

xabbuh commented Mar 1, 2016

@fabpot This failure is expected as the subtree split of the Form component doesn't know anything about the updated tests here (only the deps=high tests for the TwigBridge are failing).

👍

Status: Reviewed

@fabpot
Copy link
Member

fabpot commented Mar 1, 2016

Thank you @javiereguiluz.

fabpot added a commit that referenced this pull request Mar 1, 2016
…iluz)

This PR was squashed before being merged into the 2.7 branch (closes #17568).

Discussion
----------

Improved Bootstrap form theme for hidden fields

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

Commits
-------

ba5d7f9 Improved Bootstrap form theme for hidden fields
@fabpot fabpot closed this Mar 1, 2016
nicolas-grekas added a commit that referenced this pull request Mar 7, 2016
This PR was merged into the 2.7 branch.

Discussion
----------

fix lowest TwigBridge deps versions

| Q             | A
| ------------- | ---
| Branch        | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #17568
| License       | MIT
| Doc PR        |

This is necessary as #17568 was neither part of 2.7.10 nor 2.8.3.

Commits
-------

526376f fix lowest TwigBridge deps versions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants