Skip to content

🎥 Make videos programmatically with React

@remotion/studio: Fix code frame line number scrolling

Jonny Burger76bf27f17cd0
diff --git a/packages/studio/src/error-overlay/remotion-overlay/CodeFrame.tsx b/packages/studio/src/error-overlay/remotion-overlay/CodeFrame.tsx
index df026169ed..6bdf6922c0 100644
--- a/packages/studio/src/error-overlay/remotion-overlay/CodeFrame.tsx
+++ b/packages/studio/src/error-overlay/remotion-overlay/CodeFrame.tsx
@@ -35,6 +35,9 @@ const lineNumber: React.CSSProperties = {
alignItems: 'center',
justifyContent: 'flex-end',
fontFamily: 'monospace',
+ position: 'sticky',
+ left: 0,
+ zIndex: 1,
};
export const CodeFrame: React.FC<{
@@ -71,8 +74,11 @@ export const CodeFrame: React.FC<{
...lineNumber,
fontSize,
backgroundColor: s.highlight
- ? TRANSPARENT
+ ? ERROR_CODE_FRAME_BACKGROUND
: ERROR_CODE_FRAME_LINE_BACKGROUND,
+ backgroundImage: s.highlight
+ ? `linear-gradient(${SELECTED_BACKGROUND}, ${SELECTED_BACKGROUND})`
+ : undefined,
color: s.highlight ? WHITE : WHITE_ALPHA_40,
}}
>