Fix view-tab reactivity using direct onclick binding
- Change view-tabs from delegateEvent to direct onclick like hst-frontend - Remove hardcoded 'active' class from grid tab in HTML - Update active class immediately on click before state update - Update proxy target to tzrtech.org Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -212,16 +212,21 @@ class App {
|
||||
await this.init();
|
||||
});
|
||||
|
||||
// View tabs
|
||||
delegateEvent<MouseEvent>(document.body, '.view-tab', 'click', (_, target) => {
|
||||
const view = target.dataset.view as ViewType;
|
||||
if (!view) return;
|
||||
// View tabs - direct binding like hst-frontend
|
||||
$$('.view-tab').forEach(tab => {
|
||||
tab.onclick = () => {
|
||||
const view = tab.dataset.view as ViewType;
|
||||
if (!view) return;
|
||||
|
||||
store.setState({ view });
|
||||
this.router.updateHash();
|
||||
this.detailPanel?.close();
|
||||
this.updateViewTabs();
|
||||
this.renderView();
|
||||
// Update active class immediately
|
||||
$$('.view-tab').forEach(t => t.classList.remove('active'));
|
||||
tab.classList.add('active');
|
||||
|
||||
store.setState({ view });
|
||||
this.router.updateHash();
|
||||
this.detailPanel?.close();
|
||||
this.renderView();
|
||||
};
|
||||
});
|
||||
|
||||
// Search
|
||||
|
||||
Reference in New Issue
Block a user