Skip to content

Commit 455d124

Browse files
fix: googleTranslate breaks sandboxes (#3984)
1 parent cfcb3a2 commit 455d124

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

src/components/MDX/CodeBlock/CodeBlock.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ const CodeBlock = React.forwardRef(
7979
const decorators = getDecoratedLineInfo();
8080
return (
8181
<div
82+
translate="no"
8283
className={cn(
8384
'rounded-lg h-full w-full overflow-x-auto flex items-center bg-white shadow-lg',
8485
!noMargin && 'my-8'

src/components/MDX/ConsoleBlock.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function ConsoleBlock({level = 'info', children}: ConsoleBlockProps) {
4343
}
4444

4545
return (
46-
<div className="mb-4">
46+
<div className="mb-4" translate="no">
4747
<div
4848
className="flex w-full rounded-t-lg"
4949
style={{backgroundColor: '#DADEE0'}}>

src/components/MDX/Sandpack/CustomPreset.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export function CustomPreset({
7373
/>
7474
{isExpandable && (
7575
<button
76+
translate="yes"
7677
className="flex text-base justify-between dark:border-card-dark bg-wash dark:bg-card-dark items-center z-10 rounded-t-none p-1 w-full order-2 xl:order-last border-b-1 relative top-0"
7778
onClick={() => setIsExpanded((prevExpanded) => !prevExpanded)}>
7879
<span className="flex p-2 focus:outline-none text-primary dark:text-primary-dark">

src/components/MDX/Sandpack/NavigationBar.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ export function NavigationBar({
4646
<div className="px-4 lg:px-6">
4747
{dropdownActive ? <FilesDropdown /> : <FileTabs />}
4848
</div>
49-
<div className="px-3 flex items-center justify-end flex-grow text-right">
49+
<div
50+
className="px-3 flex items-center justify-end flex-grow text-right"
51+
translate="yes">
5052
{showDownload && <DownloadButton />}
5153
<ResetButton onReset={onReset} />
5254
<OpenInCodeSandboxButton className="ml-2 md:ml-4" />

src/components/MDX/Sandpack/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function Sandpack(props: SandpackProps) {
133133
}
134134

135135
return (
136-
<div className="my-8">
136+
<div className="my-8" translate="no">
137137
<SandpackProvider
138138
key={key}
139139
template="react"

0 commit comments

Comments
 (0)