Skip targets tab auto-refresh while color picker is open
The 2-second auto-refresh was destroying the DOM and closing the native color picker popup. Now checks if an input inside the targets panel is focused before refreshing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -42,6 +42,9 @@ export function startAutoRefresh() {
|
||||
if (apiKey) {
|
||||
const activeTab = localStorage.getItem('activeTab') || 'dashboard';
|
||||
if (activeTab === 'targets') {
|
||||
// Skip refresh while user interacts with a picker or slider
|
||||
const panel = document.getElementById('targets-panel-content');
|
||||
if (panel && panel.contains(document.activeElement) && document.activeElement.matches('input')) return;
|
||||
if (typeof window.loadTargetsTab === 'function') window.loadTargetsTab();
|
||||
} else if (activeTab === 'dashboard') {
|
||||
if (typeof window.loadDashboard === 'function') window.loadDashboard();
|
||||
|
||||
Reference in New Issue
Block a user