From 9026cf1f41dcaabacd5f02f88a88a6cfcbe692fb Mon Sep 17 00:00:00 2001 From: Ovidijus Parsiunas Date: Thu, 19 Oct 2023 18:11:20 +0100 Subject: [PATCH] fixing playground console warnings --- website/src/pages/playground.jsx | 20 +++++++++++-------- .../chat/playgroundChatComponent.js | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/website/src/pages/playground.jsx b/website/src/pages/playground.jsx index f254a4f04..4293c09e2 100644 --- a/website/src/pages/playground.jsx +++ b/website/src/pages/playground.jsx @@ -225,13 +225,17 @@ export default function Playground() { } function setHorizontalScroll(componentList) { - componentList.addEventListener('wheel', (e) => { - if (!view.isGrid) { - // scroll only when there is overflow (useful when 1 element in column and no overflow) - if (componentList.scrollWidth > componentList.clientWidth) { - e.preventDefault(); - componentList.scrollLeft += e.deltaY; + componentList.addEventListener( + 'wheel', + (e) => { + if (!view.isGrid) { + // scroll only when there is overflow (useful when 1 element in column and no overflow) + if (componentList.scrollWidth > componentList.clientWidth) { + e.preventDefault(); + componentList.scrollLeft += e.deltaY; + } } - } - }); + }, + {passive: false} + ); } diff --git a/website/src/pages/playground/chat/playgroundChatComponent.js b/website/src/pages/playground/chat/playgroundChatComponent.js index add79e0c8..4c64ecaf1 100644 --- a/website/src/pages/playground/chat/playgroundChatComponent.js +++ b/website/src/pages/playground/chat/playgroundChatComponent.js @@ -6,7 +6,7 @@ import React from 'react'; const DEMO_RESPONSE = {response: {text: "Click the 'Configure' button below to connect to a service."}}; -export default function ChatComponent({config, colorMode}) { +export default function ChatComponent({config}) { const componentRef = React.createRef(null); // updating messages here to keep track of them so that when user moves to a different page they can be added to config