Repository: EasyCorp/EasyAdminBundle (language: php)

Issue:
Safari messes up flag display in drop down on forms
**Describe the bug**
Safari doesn't seem to like the country drop down:
<img width="311" alt="Screenshot 2024-07-22 at 11 33 51" src="https://github.com/user-attachments/assets/4a6bfc1c-5258-492e-be33-e6493038a99b">

**To Reproduce**
Use a country drop down in Safari

**(OPTIONAL) Additional context**
Probably related to the fix in #6023



Discussion / hints:
@KDederichs thanks for reporting this. Safari has so many bugs/edge-cases related to SVG images 😭 

Can you please try to debug this by using the browser debug tools to add a `width` attribute explicitly to the flag SVGs? Thanks
@javiereguiluz
If you set the `height` of the image with the SVG to `17px` like in the other PR that fixed it it seems to work well:
![Screenshot 2024-07-23 at 17 22 18](https://github.com/user-attachments/assets/4634ba06-c72d-482c-ac0e-d71412c7ff1e)


Fix patch:
diff --git a/src/Field/Configurator/CountryConfigurator.php b/src/Field/Configurator/CountryConfigurator.php
index f7b63ef984..c28e47132a 100644
--- a/src/Field/Configurator/CountryConfigurator.php
+++ b/src/Field/Configurator/CountryConfigurator.php
@@ -95,7 +95,7 @@ private function generateFormTypeChoices(string $countryCodeFormat, ?array $coun
 
             $countryCodeAlpha2 = $usesAlpha3Codes ? Countries::getAlpha2Code($countryCode) : $countryCode;
             $flagImagePath = $this->assetPackage->getUrl(sprintf('images/flags/%s.svg', $countryCodeAlpha2));
-            $choiceKey = sprintf('<div class="country-name-flag"><img src="%s" class="country-flag" loading="lazy" alt="%s"> <span>%s</span></div>', $flagImagePath, $countryName, $countryName);
+            $choiceKey = sprintf('<div class="country-name-flag"><img src="%s" height="17" class="country-flag" loading="lazy" alt="%s"> <span>%s</span></div>', $flagImagePath, $countryName, $countryName);
 
             $choices[$choiceKey] = $countryCode;
         }


Test patch:
diff --git a/tests/Field/CountryFieldTest.php b/tests/Field/CountryFieldTest.php
index c0f8f461b0..e3e9915ae5 100644
--- a/tests/Field/CountryFieldTest.php
+++ b/tests/Field/CountryFieldTest.php
@@ -43,7 +43,7 @@ public function testDefaultOptionsForFormPages()
         $formSelectChoices = $fieldDto->getFormTypeOption(ChoiceField::OPTION_CHOICES);
 
         self::assertCount(self::NUM_COUNTRIES_AND_REGIONS, $formSelectChoices);
-        self::assertSame('GQ', $formSelectChoices['<div class="country-name-flag"><img src="images/flags/GQ.svg" class="country-flag" loading="lazy" alt="Equatorial Guinea"> <span>Equatorial Guinea</span></div>']);
+        self::assertSame('GQ', $formSelectChoices['<div class="country-name-flag"><img src="images/flags/GQ.svg" height="17" class="country-flag" loading="lazy" alt="Equatorial Guinea"> <span>Equatorial Guinea</span></div>']);
         self::assertSame('true', $fieldDto->getFormTypeOption('attr.data-ea-autocomplete-render-items-as-html'));
     }