@Findus23 opened this Issue on May 6th 2018 Member

I just wrote a plugin which allows switching between languages quickly. For this I created a UI_CONTROL_MULTI_SELECT with all languages (the same can be reproduced with https://plugins.matomo.org/RestrictLanguageSelection as I am using the same selector)

I can't really describe it (it feels a bit like Lights Out), so here is a video of a try to add French to German:
high quality

gif

@tsteur commented on May 6th 2018 Member

I'm not 100% sure I get what you mean but yes it is not ideal and it is kind of by design like this. This is simple the multi select we get from materializecss. In the coming up 1.0.0 they improved it a little bit see second example here: https://materializecss.com/select.html but still not ideal. There is not too much we can do I guess unless we embedded another UI library just for this. At some point we will maybe rather remove this feature (maybe in Matomo 4) and ask users to use the new multi tuple instead.

I think you may rather want to use the new multi tuple feature see https://github.com/matomo-org/matomo/blob/3.x-dev/plugins/Morpheus/templates/demo.twig#L362 .

You can use it like this:

            $this->makeSetting('fooBar', array(), FieldConfig::TYPE_ARRAY, function (FieldConfig $field) {
                $field->title = 'Foo Bar';
                $field->description = 'Optionally set one or multiple custom dimensions in scope visit.';
                $field->uiControl = FieldConfig::UI_CONTROL_MULTI_PAIR;
                $field1 = new FieldConfig\MultiPair('Language', 'languageCode', FieldConfig::UI_CONTROL_SELECT);
                $field->uiControlAttributes['field1'] = $field1->toArray();
            }),
@Findus23 commented on May 6th 2018 Member

I’m not entirely sure if it is by design that it is impossible to select an entry as always others get selected and removed kind of randomly (Gallicanian and Greek in the above video) and even others get highlighted in the drop down.

But the new multi tuple feature seem even more user friendly than an correctly working multiselect.

@tsteur commented on May 7th 2018 Member

Lets remove this UI control in Matomo 4

Powered by GitHub Issue Mirror