mirror of
https://github.com/OpenNebula/one.git
synced 2026-12-01 20:56:42 +09:00
M #-: Protect chartist (#4663)
Signed-off-by: dcarracedo <dcarracedo@opennebula.io>
This commit is contained in:
1 parent
44b3d83cbe
commit
cbaff76020
1 file changed
+4
-1
@@ -245,7 +245,10 @@ const Chartist = ({
|
||||
() => {
|
||||
if (chartRef.current) {
|
||||
requestAnimationFrame(() => {
|
||||
const { width, height } = chartRef.current.getBoundingClientRect()
|
||||
const chart = chartRef.current
|
||||
if (!chart) return
|
||||
|
||||
const { width, height } = chart.getBoundingClientRect()
|
||||
setChartDimensions({
|
||||
width: Math.max(width - 16, 50), // Clamping
|
||||
height: Math.max(height - 32, 50), // Clamping
|
||||
|
||||
Reference in new issue
Block a user