Shadow in SwiftUI gets removed when the item is offscreen but the shadow is still visible

I have a SwiftUI view which consists on a horizontal scroll view with some pages inside.

The elements of the pages project shadows.

I noticed that when scrolling, as elements stop being visible, the shadow gets removed abruptly. The shadow itself is visible when it gets removed and it creates an unpleasant effect.

I tried adding a transparent background to the element with the shadow that extends its frame to see if that way the shadow would be retained longer but it didn't work.

Is there any workaround to make this behave the way I would like?

Thanks in advance

It seems it's not possible to post videos on the dev forums but I captured 3 frames of it showcasing the issue.

Shadow in SwiftUI gets removed when the item is offscreen but the shadow is still visible
 
 
Q