question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to delete/close a TabSet?

See original GitHub issue

I’m trying to programmatically delete a TabSet.

Actions.deleteTab doesn’t do anything (possibly because it’s not a tab): https://github.com/caplin/FlexLayout/blob/d8cac2915e8968a26bf3592ffe70c248c0d9d2dc/src/model/Model.ts#L257

model.doAction(Actions.deleteTab(tabSet.getId()));

Deleting each tab separately closes all the tabSet’s content, but the tabset itself is still there.

tabSet
  .getChildren()
  .map((node) => Actions.deleteTab(node.getId()))
  .forEach((action) => model.doAction(action));

I tried updating the parent’s attributes too, eg.:

const parent = tabSet.getParent();
if (isNil(parent)) {
  return;
}
// Logic not exactly the same, but illustrates my point
model.doAction(Actions.updateNodeAttributes(parent.getId(), { children: [] }));

But this doesn’t do anything either.

Can you advise on how to kill a tabset?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nealuscommented, Oct 6, 2021

There should be a view folder, I just tried removing node modules and calling yarn again in the CRA example and I’ve got the view folder

1reaction
nealuscommented, Oct 5, 2021

Added v0.5.16 with tabset attribute ‘enableClose’ for this, or you can use the action deleteTabset. See the New Features layout in the demo for an example https://rawgit.com/caplin/FlexLayout/demos/demos/v0.5/demo/index.html

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Delete Recently Closed Tabs on Google Chrome
The easiest way to clear your Chrome recently closed tabs list is to close out of Chrome twice, as explained by Addictive Tips....
Read more >
How to delete only "recently closed tabs" in Chrome?
1) check first what's on the list of "recently closed" tabs. · 2) open each and every one of those previously closed tabs...
Read more >
How to Delete Recently Closed Tabs on Google Chrome
Click the wrench icon at the top of the page and click "History." Click "Edit Items" and check the box next to each...
Read more >
Safari 101: How to Clear Your Recently Closed Tabs List
Next, tap "Clear," then select any of the four time ranges offered. No matter which option you choose, each will erase all your...
Read more >
How to Close One or All Tabs in a Browser: Mobile & Desktop
1. Open a mobile browser. Tap the app icon of the browser that you want to open. You can close tabs on Google Chrome...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found