brrd / electron-tabs

Tab component for Electron
MIT License
687 stars 123 forks source link

Add a way to destroy tabGroup #129

Open ooobsidian opened 2 years ago

ooobsidian commented 2 years ago

When developing an electron application, how do I destroy the newly created tabGroup object, that is, how do I make the tab bar disappear?

brrd commented 2 years ago

Currently there is no method to do this so you will have to to it manually by destroying the .etabs-tabgroup element and emptying the tabGroup variable.

var el = document.querySelector(.etabs-tabgroup);
if (el.parentNode !== null) {
  el.parentNode.removeChild(el);
}
tabGroup = null;

I will keep this issue open because it would be useful to add a proper way to do this. Maybe by moving the whole lib to web components.

ooobsidian commented 2 years ago

Thanks!