madeyourday/contao-rocksolid-custom-elements

Toolbar button not clickable in list

Closed this issue · 7 comments

The toolbar button of the items in a list are not clickable. My config is a list containing two fileTree inputs. Tested in Google Chrome and Firefox with the same result.

The problem seems to be that the fieldset of an item is stacked on top of their toolbar div. Adding a z-index to the toolbar fixes it of course.

Am I doing something wrong or is this a bug?

ausi commented

Can you post the code from your rsce_…_config.php file so that we can try to reproduce the issue?

Sure

<?php
return array(
    'label' => array('Zertifikat-Logos', 'Element zur Darstellung von Zertifikat-Logos'),
    'types' => array('content'),
    'contentCategory' => 'media',
    'standardFields' => array('cssID'),
    'wrapper' => array(
        'type' => 'none',
    ),
    'fields' => array(
        'certs' => array(
            'label' => 'Zertifikate',
            'inputType' => 'list',
            'fields' => array(

                'image' => array(
                    'label' => array('Anzeigebild für Zertifikat ', ''),
                    'inputType' => 'fileTree',
                    'eval'      => array(
                        'files'      => true,
                        'mandatory'  => true,
                        'extensions' => \Config::get('validImageTypes')
                    )
                ),
                'file' => array(
                    'label' => array('Zertifikat PDF-Datei', ''),
                    'inputType' => 'fileTree',
                    'eval'      => array(
                        'files'      => true,
                        'mandatory'  => true,
                        'extensions' => 'pdf'
                    )
                )
            )
        )
    )
ausi commented

This should be fixed if you add an element label like so: 'elementLabel' => 'Zertifikat %s',

That doesn't seem to work for me.

Just to be sure that it is in the right spot, i posted the new code. To be sure nothing else is influencing that problem, i will try it again with a clean contao installation and come back to you, if the problem also happens there.

<?php
return array(
    'label' => array('Zertifikat-Logos', 'Element zur Darstellung von Zertifikat-Logos'),
    'types' => array('content'),
    'contentCategory' => 'media',
    'standardFields' => array('cssID'),
    'wrapper' => array(
        'type' => 'none',
    ),
    'fields' => array(
        'certs' => array(
            'label' => 'Zertifikate',
            'inputType' => 'list',
            'elementLabel' => 'Zertifikat %s',
            'fields' => array(

                'image' => array(
                    'label' => array('Anzeigebild für Zertifikat ', ''),
                    'inputType' => 'fileTree',
                    'eval'      => array(
                        'files'      => true,
                        'mandatory'  => true,
                        'extensions' => \Config::get('validImageTypes')
                    )
                ),
                'file' => array(
                    'label' => array('Zertifikat PDF-Datei', ''),
                    'inputType' => 'fileTree',
                    'eval'      => array(
                        'files'      => true,
                        'mandatory'  => true,
                        'extensions' => 'pdf'
                    )
                )
            )
        )
    )
);

I noticed this issue as well, and indeed it happened in my because because of missing elementLabel => "... %s".

Potentially easy fix/workaround for those who don't use (or forget) elementLabel would be to add z-index: 1 to .rsce_list_item > .rsce_list_toolbar CSS Rule. I could open a PR for this if contributors are ok with it.

ausi commented

I think a better fix would probably be to set the default values of elementLabel to '%s'

I think a better fix would probably be to set the default values of elementLabel to '%s'

It would be indeed. I will try to implement that and make a PR.