From 3ef836cf4963e1da11e13f74877d2c543b61afbf Mon Sep 17 00:00:00 2001 From: Miroslav Blasko Date: Wed, 19 Jun 2024 14:25:55 +0200 Subject: [PATCH] [Fix] Workaround for out-of-range warning of material-ui component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes material-ui warning: """ You have provided an out-of-range value `http://onto.fel.cvut.cz/ontologies/fta-fmea-application/system/instance1574699916` for the select component. Consider providing a value that matches one of the available options or ‘’. The available values are “”. """ --- src/components/appBar/AppBar.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/appBar/AppBar.tsx b/src/components/appBar/AppBar.tsx index b2ef2588..8f06850f 100644 --- a/src/components/appBar/AppBar.tsx +++ b/src/components/appBar/AppBar.tsx @@ -152,7 +152,11 @@ const AppBar = ({ title, showBackButton = false, topPanelHeight }: Props) => { select InputLabelProps={{ shrink: false }} className={classes.textfieldSelect} - value={selectedSystem ? selectedSystem.iri : ""} + value={ + selectedSystem?.iri && systemsList.some((s) => s.iri === selectedSystem.iri) + ? selectedSystem.iri + : "" + } onChange={handleSystemChange} disabled={dropdownDisabled} >