Closed yuzhva closed 4 years ago
The solution is found.
When adding a command, the stop() {}
function is required ❗️
editor.Commands.add('set-device-NAME', {
run() {
editor.setDevice(deviceName);
},
stop() {
// NOTE: stop key {stop ()} is required
// the panel button will have an "-active" class after it is has been pressed
}
});
The bug present also in the demo: https://grapesjs.com/demo-newsletter-editor.html
Desktop, tablet, mobile buttons are not being active after init, also they are not changing after screen size has been changed.