Skip to content

Commit

Permalink
fix(replay): Allow replay player instances to be interactable/scrolla…
Browse files Browse the repository at this point in the history
…ble again (#77647)

Broke in
https://github.com/getsentry/sentry/pull/76927/files#diff-e10692ee093e56669e267837b07b16ed1d800a6dc996049aea27186f5fe0b8bbR21
because that code is used by:
https://github.com/getsentry/sentry/blame/21e8cd7/static/app/components/replays/replayPlayer.tsx#L185-L193

Fixes #77608 (comment)


1. What I've done is make all the replay views "inspectable" by allowing
pointer-events. So links can be clicked inside the replay... but also
doing "Right-Click -> Inspect Element" works great again.

2. The attribute `scrolling="no"` is set, and from what I can tell was
always set on the iframe. So i'm not sure how or when that behavior
changed.
  • Loading branch information
ryan953 authored Sep 17, 2024
1 parent d40229d commit e13e984
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
1 change: 0 additions & 1 deletion static/app/components/replays/player/replayPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export default function ReplayPlayer({offsetMs, ...props}: Props) {
return (
<div
{...props}
data-inspectable={props['data-inspectable']}
css={[baseReplayerCss, sentryReplayerCss, props.css]}
ref={mountPointRef}
/>
Expand Down
2 changes: 0 additions & 2 deletions static/app/components/replays/player/styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ export const baseReplayerCss = css`
.replayer-wrapper > iframe {
border: none;
background: white;
}
&[data-inspectable='true'] .replayer-wrapper > iframe {
/* Set pointer-events to make it easier to right-click & inspect */
pointer-events: initial !important;
}
Expand Down
9 changes: 3 additions & 6 deletions static/app/components/replays/replayPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,10 @@ const PositionedLoadingIndicator = styled(LoadingIndicator)`
position: absolute;
`;

// Base styles, to make the Replayer instance work
const PlayerRoot = styled(BasePlayerRoot)`
const SentryPlayerRoot = styled(BasePlayerRoot)`
/* Base styles, to make the Replayer instance work */
${baseReplayerCss}
`;

// Sentry-specific styles for the player.
const SentryPlayerRoot = styled(PlayerRoot)`
/* Sentry-specific styles for the player */
${p => sentryReplayerCss(p.theme)}
`;

Expand Down

0 comments on commit e13e984

Please sign in to comment.