Error in Documentation for Panel Dropdowns

I found an Error in the documentation for panel dropdowns

In section “Listen for dropdown event” it has to be:

$dropdown[] = [
    'icon'  => 'share',
    'text'  => 'Publish on Netlify',
    'click' => [
        /* 'key' => 'myEvent' - does not work */
        'global'  => 'myEvent', /* changed from 'true' to event name */
        'payload' => [...]
    ]
];

I have checked the https://github.com/getkirby/kirby/blob/main/panel/src/components/Dropdowns/DropdownContent.vue in Order to find the problem, because the this.$events.on("myEvent", (payload) => {...}); did not fire, until i changed the code like above and now the event is triggered in my js-script.

1 Like

I’ve created a PR for this here: fix docs for global events on custom dropdowns by rasteiner · Pull Request #2357 · getkirby/getkirby.com · GitHub

1 Like