From 1cb9757725b2e8e967191f420f1dac8d641e950e Mon Sep 17 00:00:00 2001 From: Bruce Harrison Date: Thu, 12 Jan 2023 11:55:16 -0600 Subject: [PATCH] fix css updates --- .../src/providers/EventIntersectionProvider.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/Schedulely/src/providers/EventIntersectionProvider.tsx b/packages/Schedulely/src/providers/EventIntersectionProvider.tsx index db208c9..c58660a 100644 --- a/packages/Schedulely/src/providers/EventIntersectionProvider.tsx +++ b/packages/Schedulely/src/providers/EventIntersectionProvider.tsx @@ -59,14 +59,17 @@ export const EventIntersectionProvider = ({ entries.map((x) => { var eventId = x.target.attributes.getNamedItem('data-eventid')?.value; - const currentStyle = x.target - .getAttribute('style') - ?.replaceAll(/\svisibility:.*;/g, ''); + const currentStyle = + x.target + .getAttribute('style') + ?.split(';') + .filter((x) => x && !x.includes('visibility')) || []; if (x.isIntersecting) - x.target.setAttribute('style', currentStyle || ''); + x.target.setAttribute('style', currentStyle.join(';')); else { - x.target.setAttribute('style', `${currentStyle} visibility: hidden;`); + currentStyle.push('visibility: hidden'); + x.target.setAttribute('style', currentStyle.join(';')); } const matchingEvent = events.find((x) => x.id === eventId);