kirby
kirby copied to clipboard
Wrong code example in panel/drawer.js / needs confirmation
Hi all,
why fiddling around with the Kirby 4 Drawer API I found some examples in panel/drawer.js
to be not correct.
https://github.com/getkirby/kirby/blob/main/panel/src/panel/drawer.js#L118-L125
I needed to wrap my listeners (submit, cancel) in an object.
// Instead of this (as in the example code):
panel.drawer.open({
component: 'k-forms-drawer',
submit: () => {},
cancel: () => {}
});
// I needed to do this
panel.drawer.open({
component: 'k-forms-drawer',
// Wrap listeners in object with key on
on: {
submit: () => {},
cancel: () => {}
}
});
Can someone confirm this?