Search code examples
responsive-designinlinesonata-adminsonata

Sonata admin type collection inline table responsive


I try to understand why sonata type collection is configure to be edit inline table, the table isn't responsive. On mobile screen when I've got a table with many field, all the field doesn't appear and there is no scroll to see them? Someone have the same problem?


Solution

  • There was a PR that wasn't merged yet, so there are changes that need to be done manually in the meantime:

    Add this to a style.css in sonata's layout(extend the template and add the css in the styles block).

    /* table list scrollbar */
     .box .box-body {
         overflow-x: auto;
         overflow-y: hidden;
     }
    
     .sonata-ba-list .pull-right.fix-overflow {
         position: absolute;
         right: 10px;
         bottom: 10px;
    }
    

    And in base_list.html.twig :

     <div class="pull-right fix-overflow">