Commit 51b62da5 authored by tom's avatar tom

disable svg selection

parent 17479294
...@@ -9,6 +9,10 @@ const global = (props: StyleFunctionProps) => ({ ...@@ -9,6 +9,10 @@ const global = (props: StyleFunctionProps) => ({
...getDefaultTransitionProps(), ...getDefaultTransitionProps(),
'-webkit-tap-highlight-color': 'transparent', '-webkit-tap-highlight-color': 'transparent',
}, },
'svg *::selection': {
color: 'none',
background: 'none',
},
form: { form: {
w: '100%', w: '100%',
}, },
......
...@@ -43,7 +43,7 @@ const EthereumDailyTxsChart = () => { ...@@ -43,7 +43,7 @@ const EthereumDailyTxsChart = () => {
}, [ ]); }, [ ]);
return ( return (
<Box display="inline" position="relative"> <Box display="inline-block" position="relative" width="100%" height="100%">
<svg width={ width || '100%' } height={ height || '100%' } ref={ ref }> <svg width={ width || '100%' } height={ height || '100%' } ref={ ref }>
<g transform={ `translate(${ CHART_MARGIN?.left || 0 },${ CHART_MARGIN?.top || 0 })` } opacity={ width ? 1 : 0 }> <g transform={ `translate(${ CHART_MARGIN?.left || 0 },${ CHART_MARGIN?.top || 0 })` } opacity={ width ? 1 : 0 }>
{ /* BASE GRID LINE */ } { /* BASE GRID LINE */ }
......
...@@ -35,7 +35,6 @@ const ChartAxis = ({ type, scale, ticks, tickFormat, disableAnimation, anchorEl, ...@@ -35,7 +35,6 @@ const ChartAxis = ({ type, scale, ticks, tickFormat, disableAnimation, anchorEl,
axisGroup.select('.domain').remove(); axisGroup.select('.domain').remove();
axisGroup.selectAll('line').remove(); axisGroup.selectAll('line').remove();
axisGroup.selectAll('text') axisGroup.selectAll('text')
.attr('user-select', 'none')
.attr('opacity', 1) .attr('opacity', 1)
.attr('color', textColor) .attr('color', textColor)
.attr('font-size', '0.75rem'); .attr('font-size', '0.75rem');
......
...@@ -55,7 +55,6 @@ const ChartTooltip = ({ xScale, yScale, width, height, data, margin: _margin, an ...@@ -55,7 +55,6 @@ const ChartTooltip = ({ xScale, yScale, width, height, data, margin: _margin, an
tooltipContent tooltipContent
.select('.ChartTooltip__contentTitle') .select('.ChartTooltip__contentTitle')
.attr('user-select', 'none')
.text(d3.timeFormat('%b %d, %Y')(xScale.invert(x))); .text(d3.timeFormat('%b %d, %Y')(xScale.invert(x)));
}, },
[ xScale, margin, width ], [ xScale, margin, width ],
...@@ -63,7 +62,6 @@ const ChartTooltip = ({ xScale, yScale, width, height, data, margin: _margin, an ...@@ -63,7 +62,6 @@ const ChartTooltip = ({ xScale, yScale, width, height, data, margin: _margin, an
const onChangePosition = React.useCallback((d: TimeChartItem, isVisible: boolean) => { const onChangePosition = React.useCallback((d: TimeChartItem, isVisible: boolean) => {
d3.select('.ChartTooltip__value') d3.select('.ChartTooltip__value')
.attr('user-select', 'none')
.text(isVisible ? d.value.toLocaleString() : ''); .text(isVisible ? d.value.toLocaleString() : '');
}, []); }, []);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment