Skip to content

Commit

Permalink
Fixed scrollEditorToPath not firing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
OAGr committed Jan 25, 2024
1 parent e6dde34 commit ed68888
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,12 @@ export const ValueViewer: React.FC<Props> = ({ value, ...rest }) => {
return <MessageAlert heading="Can't display pathless value" />;
}

return <ValueWithContextViewer value={value} {...rest} />;
// This key is important, so that scrollEditorToPath() will work correctly when zoomed in.
return (
<ValueWithContextViewer
value={value}
key={value.context.path.uid()}
{...rest}
/>
);
};

2 comments on commit ed68888

@vercel
Copy link

@vercel vercel bot commented on ed68888 Jan 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on ed68888 Jan 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.