/** * Utility function to update the custom state of an element. Necessary as Chrome upgrades to the new standard and the old syntax is deprecated * @param elInternals * @param action * @param state */ export function updateCustomState(elInternals: ElementInternals | undefined, action: string, state: string) { try { // @ts-ignore elInternals?.states?.[action](state); } catch { // @ts-ignore elInternals?.states?.[action](`--${state}`); } }