fix: column view navigation and duplicate app instance
- Fix duplicate tsview-app rendering by checking if element already exists in HTML - Fix column navigation to expand horizontally instead of resetting - Remove navigate event dispatch from column folder selection to preserve column state
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -186,14 +186,8 @@ export class TsviewS3Columns extends DeesElement {
|
|||||||
console.error('Error loading folder:', err);
|
console.error('Error loading folder:', err);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dispatch navigate event
|
// Note: Don't dispatch navigate event here - columns view expands horizontally
|
||||||
this.dispatchEvent(
|
// The navigate event is only for breadcrumb sync, not for column navigation
|
||||||
new CustomEvent('navigate', {
|
|
||||||
detail: { prefix },
|
|
||||||
bubbles: true,
|
|
||||||
composed: true,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private selectFile(columnIndex: number, key: string) {
|
private selectFile(columnIndex: number, key: string) {
|
||||||
|
|||||||
@@ -13,9 +13,11 @@ const initApp = async () => {
|
|||||||
// Wait for custom elements to be defined
|
// Wait for custom elements to be defined
|
||||||
await customElements.whenDefined('tsview-app');
|
await customElements.whenDefined('tsview-app');
|
||||||
|
|
||||||
// Create and mount the app
|
// Only create the app element if it doesn't already exist in HTML
|
||||||
|
if (!document.querySelector('tsview-app')) {
|
||||||
const app = document.createElement('tsview-app');
|
const app = document.createElement('tsview-app');
|
||||||
document.body.appendChild(app);
|
document.body.appendChild(app);
|
||||||
|
}
|
||||||
|
|
||||||
console.log('TsView UI ready');
|
console.log('TsView UI ready');
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user