With TinyMCE V6, in a custom dialogs, i’d like to handle the tab change event of a tabpanel which got two tabs. I tried to use ‘OnTabChange’, ‘OnChange’ but none of them was never fired. How can i achieve this?
Here’s the code i used:
let activeTab = 'Insert_UGC_From_ID';
const InsertUgcPanel = {
title: 'Insertion'
body: {
type: 'tabpanel',
tabs: [...]
}
]
},
buttons: [{
type: 'custom',
name: 'insert-UGC-button',
text: 'Insérer la chaîne'
},
{
type: 'custom',
name: 'doesnothing',
text: 'Annuler'
}
],
onTabChange: (dialogApi, details) => {
if (details.name) {
activeTab = details.name;}
},
onAction: (dialogApi, details) => {
if (details.name === 'insert-UGC-button') {
const data = dialogApi.getData()
dialogApi.close()
} else if (details.name === 'doesnothing') {
dialogApi.close()
}
}
};