Skip to content

Commit

Permalink
fix css updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bruceharrison1984 committed Jan 12, 2023
1 parent a8ef2f1 commit 1cb9757
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/Schedulely/src/providers/EventIntersectionProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1cb9757

Please sign in to comment.