multiple inconsistencies fixed (AI)
This commit is contained in:
@@ -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')) {
|
||||
|
||||
Reference in New Issue
Block a user