1 // :has() selector doesn't work in Firefox, so need to use JS to add/remove class
2 export function trackFocus(selector: string, cbElement: any) {
3 const element = document.querySelector(selector);
5 throw new Error(`Element with selector ${selector} not found`);
8 cbElement.on('focus', () => {
9 element.closest('.card-input--one-line')?.classList.add('focus');
12 cbElement.on('blur', () => {
13 element.closest('.card-input--one-line')?.classList.remove('focus');