From ae422a09ac6c6e1354fbbfd339dc8c0422a13d54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Dal=C3=A9n?= Date: Wed, 19 Jun 2024 18:57:29 +0200 Subject: [PATCH] Show imported value initially in MUI autocomplete inputs (#1065) * Show imported value initially in MUI autocomplete inputs When importing a query from for example json logic, show the imported value initially in autocomplete inputs that use an asyncFetch. Before this they would show no value at all until you clicked on them and they loaded all the options. * fix --------- Co-authored-by: ukrbublik --- packages/mui/modules/widgets/value/MuiAutocomplete.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/mui/modules/widgets/value/MuiAutocomplete.jsx b/packages/mui/modules/widgets/value/MuiAutocomplete.jsx index 25baf304b..58328b0a0 100644 --- a/packages/mui/modules/widgets/value/MuiAutocomplete.jsx +++ b/packages/mui/modules/widgets/value/MuiAutocomplete.jsx @@ -99,17 +99,17 @@ export default (props) => { const renderInput = (params) => { // parity with Antd const shouldRenderSelected = !multiple && !open; - const selectedTitle = selectedListValue?.title ?? ""; + const selectedTitle = selectedListValue?.title ?? value?.toString() ?? ""; const shouldHide = multiple && !open; - const value = shouldRenderSelected ? selectedTitle : (shouldHide ? "" : inputValue ?? ""); + const renderValue = shouldRenderSelected ? selectedTitle : (shouldHide ? "" : inputValue ?? value?.toString() ?? ""); return (