From c97372739c63f85ce3555387eb5ae31f8dad56b8 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Mon, 25 Oct 2021 08:42:04 +0200 Subject: [PATCH] containers: prevent errors with some color formats in colorWidget --- CHANGELOG.md | 1 + src/client/ui/scrollbar-color.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72c86dfe..ba68473d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - bug fixes - menu: interaction issue on iOS - script: prevent script functions from being called in the wrong scope (ie when leaked using the `globals` object) and print an explicit error + - containers: prevent errors with some color formats in colorWidget - widgets - when a panel contains widgets and has `scroll` set to `true`, its value will be used to represent the scroll position for x-axis and y-axis between 0 and 1. diff --git a/src/client/ui/scrollbar-color.js b/src/client/ui/scrollbar-color.js index 6606903e..57c5823d 100644 --- a/src/client/ui/scrollbar-color.js +++ b/src/client/ui/scrollbar-color.js @@ -18,8 +18,10 @@ module.exports = (container)=>{ } if (color) { - container.style.setProperty('--color-scrollbar', chroma(color).alpha(alpha).css()) - container.style.setProperty('--color-scrollbar-on', chroma(color).alpha(alphaOn).css()) + try { + container.style.setProperty('--color-scrollbar', chroma(color).alpha(alpha).css()) + container.style.setProperty('--color-scrollbar-on', chroma(color).alpha(alphaOn).css()) + } catch(e) {} } })