Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: set-picked-card-label #76

Merged
merged 1 commit into from
Feb 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat(editor): automatically set a tab label when picking a card
kinghat committed Jan 17, 2023
commit e7ed1fa6db86f4e42020bede6f8664d58777eb5f
8 changes: 7 additions & 1 deletion src/tabbed-card-editor.ts
Original file line number Diff line number Diff line change
@@ -142,7 +142,13 @@ export class TabbedCardEditor extends LitElement {
if (!this._config) return;

const cardConfig = ev.detail.config;
const tabs = [...this._config.tabs, { card: cardConfig }];
const newTab = {
card: cardConfig,
attributes: {
label: `New Tab ${this._tabSelection}`,
},
};
const tabs = [...this._config.tabs, newTab];

this._config = { ...this._config, tabs };