#98549SVG icons with no explicit height/width are not displayed under singleSelect fields
Description
When you have a singleSelect in BE and add some SVGs as icon and the SVG has to explicit width or height, then no icon is shown under the select field, for example the Backenlayout icons or a custom singleSelect.
TCA
'tx_rds_header_color' => [
'exclude' => true,
'label' => 'Farbe',
'description' => 'Beschreibung',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
[
'Standard',
'default'
],
[
'cyan',
'cyan',
'EXT:my_ext/Resources/Public/Icons/Colors/21ACCD.svg'
],
[
'schwarzblau',
'schwarzblau',
'EXT:my_ext/Resources/Public/Icons/Colors/5F7DA0.svg'
],
[
'white',
'white',
'EXT:my_ext/Resources/Public/Icons/Colors/FFFFFF.svg'
]
],
'fieldWizard' => [
'selectIcons' => [
'disabled' => false,
],
],
],
],
SVG
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><rect width="24" height="24" style="fill:#5f7da0"/></svg>
Workaround: add height and width to SVG
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><rect width="24" height="24" style="fill:#5f7da0"/></svg>
better solution:
Set a min-height and min-width in CSS for the places where the icons should be shown, in case no dimension was set in the SVG
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Files 3
History 1
-
Garvin Hicking commented and changed status
NewClosed 06/20/24, 07:23
Tnis is no longer reproducible with the revamped backend of TYPO3v12 and v13. Thank your for the report, I will close this issue for now, if you feel this is a mistake or have additional feedback, please get in touch. You can also create a follow-up issue.