sonata-project / SonataAdminBundle

The missing Symfony Admin Generator
https://docs.sonata-project.org/projects/SonataAdminBundle
MIT License
2.11k stars 1.26k forks source link

Input groups have not got the default styling #4319

Closed FireLizard closed 4 years ago

FireLizard commented 7 years ago

Environment

Sonata packages

sonata-project/admin-bundle              3.13.0 The missing Symfony Admin Generator
sonata-project/block-bundle              3.3.0  Symfony SonataBlockBundle
sonata-project/cache                     1.0.7  Cache library
sonata-project/core-bundle               3.2.0  Symfony SonataCoreBundle
sonata-project/datagrid-bundle           2.2    Symfony SonataDatagridBundle
sonata-project/doctrine-extensions       1.0.2  Doctrine2 behavioral extensions
sonata-project/doctrine-orm-admin-bundle 3.1.3  Symfony Sonata / Integrate Doctrine ORM into the SonataAdminBundle
sonata-project/easy-extends-bundle       2.1.10 Symfony SonataEasyExtendsBundle
sonata-project/exporter                  1.7.0  Lightweight Exporter library
sonata-project/google-authenticator      1.0.2  Library to integrate Google Authenticator into a PHP project
sonata-project/translation-bundle        2.1.0  SonataTranslationBundle
sonata-project/user-bundle               3.2.0  Symfony SonataUserBundle

Symfony packages

symfony/monolog-bundle     2.11.3  Symfony MonologBundle
symfony/phpunit-bridge     v2.8.16 Symfony PHPUnit Bridge
symfony/polyfill-apcu      v1.3.0  Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-intl-icu  v1.3.0  Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring  v1.3.0  Symfony polyfill for the Mbstring extension
symfony/polyfill-php54     v1.3.0  Symfony polyfill backporting some PHP 5.4+ features to lower PHP versions
symfony/polyfill-php55     v1.3.0  Symfony polyfill backporting some PHP 5.5+ features to lower PHP versions
symfony/polyfill-php56     v1.3.0  Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70     v1.3.0  Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-util      v1.3.0  Symfony utilities for portability of PHP codes
symfony/security-acl       v3.0.0  Symfony Security Component - ACL (Access Control List)
symfony/swiftmailer-bundle v2.4.2  Symfony SwiftmailerBundle
symfony/symfony            v2.8.16 The Symfony PHP framework

PHP version

PHP 7.1.0 (cli) (built: Jan 17 2017 19:16:55) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.1.0-dev, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.1.0, Copyright (c) 1999-2016, by Zend Technologies
    with Xdebug v2.5.0, Copyright (c) 2002-2016, by Derick Rethans

Subject

Caused by PR 2950, the styling of the CSS-class input-group-addon are not the default one defined by Bootstrap - Input groups. To get the default look of Bootstrap I have to set:

.input-group-addon
{
    width: 1%;
}

IMHO a default behaviour should always be extended rather than overwritten.

Steps to reproduce

Create an Admin with 'percentage'-FormType:

<?php
namespace AppBundle\Admin;

use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Form\FormMapper;

class MyAdmin extends AbstractAdmin
{
    /**
     * @param FormMapper $formMapper
     */
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
            ->with('Form', [
                'class' => 'col-xs-6',
            ])
                ->add('titel')
                ->add('field', 'percent', [
                    'data' => 1,
                    'mapped' => false,
                ])
            ->end()
        ;
    }
}

Expected results

expected

Actual results

notexpected

jordisala1991 commented 6 years ago

If some fields are rendering correct and others not, it shouls be easily fixable by looking at what is missing on the percent field type. Probably some selector in css is not considering it.

Edited: its not that easy

stale[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.