Skip to content

Commit

Permalink
bug(web): prevent translation causing crashing on edge browser (elect…
Browse files Browse the repository at this point in the history
…ricitymaps#6809)

* bug(web): prevent translation causing crashing on edge browser

* bug(web): add comment
  • Loading branch information
tonypls authored Jun 7, 2024
1 parent 6e532ff commit f4e8fe7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions web/src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export function Button({
type={componentType}
onClick={onClick}
target="_blank"
// Used to prevent browser translation crashes on edge, see #6809
translate="no"
>
{icon}
{children}
Expand Down
5 changes: 3 additions & 2 deletions web/src/features/charts/tooltips/BreakdownChartTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ export function BreakdownChartTooltipContent({
)}

{!displayByEmissions && (
<>
// Used to prevent browser translation crashes on edge, see #6809
<div translate="no">
<MetricRatio
value={usage}
total={totalElectricity}
Expand Down Expand Up @@ -226,7 +227,7 @@ export function BreakdownChartTooltipContent({
label={t('ofCO2eq')}
useTotalUnit
/>
</>
</div>
)}
{!displayByEmissions && (Number.isFinite(co2Intensity) || usage !== 0) && (
<>
Expand Down

0 comments on commit f4e8fe7

Please sign in to comment.