Closed howest-ward closed 1 month ago
Hello @howest-ward
Thanks for reporting this, is there a chance you can provide a screenshot about this, and if you have a way to solve, would you like to create a PR?
Cheers.
Before (size() not applied to Vat number, the margin below date of birth and Vat number are not the same)
There are 2 options, the mb-3 can be added to the default, or the mb-3 can be removed when using size.
Option 1 (mb-3 added to the default, margins are the same)
Option 2 (mb-3 removed from the wrapper_start, margins are the same but fields are closer to each other)
Because adding mb-3 to the default will have a visual change in all backpack installations.
Hello @howest-ward
Thanks for your details, here is the PR to fix it, can you test it and we will merge it ASAP.
I will close the issue to continue discussion in PR.
Cheers.
This has been tested and averything work fine! thanks!
Bug report
What I did
When using the size() method on a CrudField the classes added to the fields are
'form-group col-md-'.$numberOfColumns
If you don't use size the default in the wrapper_start_blade is
form-group col-sm-12 mb-3
Adding a default bottom-margin
What I expected to happen
All fields should be spaced evenly with the same bottom margin.
What happened
Fields in columns set bij size() method are closer to each other
What I've already tried to fix it
Modify CrudField size method
$this->attributes['wrapper']['class'] = 'form-group col-md-'.$numberOfColumns;
Into this
$this->attributes['wrapper']['class'] = 'form-group col-md-'.$numberOfColumns.' mb-3';
Backpack, Laravel, PHP, DB version
When I run
php artisan backpack:version
the output is:PHP VERSION:
8.3.8
PHP EXTENSIONS:
Core, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, random, Reflection, SPL, session, standard, sodium, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, iconv, exif, mysqli, pdo_dblib, pdo_mysql, Phar, posix, readline, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xmlreader, xmlwriter, xsl, zip, mailparse, pdo_sqlsrv, Zend OPcache
LARAVEL VERSION:
11.21.0.0
BACKPACK PACKAGE VERSIONS:
backpack/basset: 1.3.6 backpack/crud: 6.7.33 backpack/generators: v4.0.5 backpack/pro: 2.2.17 backpack/theme-tabler: 1.2.12