multiple inconsistencies fixed (AI)

This commit is contained in:
2025-12-07 20:12:48 +01:00
parent 95367b4d14
commit d38b4c7813
8 changed files with 283 additions and 50 deletions

View File

@@ -140,11 +140,17 @@ export class Calculator {
}
setupEventListeners() {
// Event delegation for calculator buttons
// Event delegation for calculator buttons - only handle from active tab's calculator
document.addEventListener('click', (e) => {
// Only handle clicks on calculator buttons
if (!e.target.classList.contains('calc-btn')) return;
// Verify the button is in the active tab's calculator (if app is initialized)
const activeContent = document.querySelector('.tab-content.active');
if (activeContent && !activeContent.contains(e.target)) {
return; // Button is not in active tab's calculator
}
const button = e.target;
if (button.classList.contains('number')) {