From 5171f59044c7be7d99fe4f6f7816bc073c3c8b1c Mon Sep 17 00:00:00 2001 From: Pierre-Charles David Date: Wed, 22 Jan 2025 16:52:33 +0100 Subject: [PATCH] [4455] Keep reference values navigable even when in read-only mode Bug: https://github.com/eclipse-sirius/sirius-web/issues/4455 Signed-off-by: Pierre-Charles David --- CHANGELOG.adoc | 2 +- .../src/components/ValuedReferenceAutocomplete.tsx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index a2ef74d541..2ed2f0de3d 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -263,7 +263,7 @@ These components could be reused by downstream applications in custom creation t - https://github.com/eclipse-sirius/sirius-web/issues/4333[#4333] [diagram] Improve the style of the palette by switching the positions of the search field and the quick access tools and by adding a small touch of grey in the header bar and search field - https://github.com/eclipse-sirius/sirius-web/issues/4286[#4286] [sirius-web] Make default explorer drag and drop work only for the default explorer. Downstream applications with a custom explorer that relies on `ExplorerDropTreeItemHandler` now need to provide their own `IDropTreeItemHandler` to support drag and drop in their explorer. - +- https://github.com/eclipse-sirius/sirius-web/issues/4455[#4455] [forms] Even when in read-only mode, the values displayed in a _Reference_ widgets are now clickable so that the user can navigate to the reference's values. == v2024.11.0 diff --git a/packages/forms/frontend/sirius-components-widget-reference/src/components/ValuedReferenceAutocomplete.tsx b/packages/forms/frontend/sirius-components-widget-reference/src/components/ValuedReferenceAutocomplete.tsx index 62049fdaf0..767f3881f1 100644 --- a/packages/forms/frontend/sirius-components-widget-reference/src/components/ValuedReferenceAutocomplete.tsx +++ b/packages/forms/frontend/sirius-components-widget-reference/src/components/ValuedReferenceAutocomplete.tsx @@ -245,7 +245,7 @@ export const ValuedReferenceAutocomplete = ({ disableClearable renderTags={(value, getTagProps) => value.map((option, index) => { - const { key, ...tagProps } = getTagProps({ index }); + const { key, onDelete, ...tagProps } = getTagProps({ index }); return ( } - clickable={!readOnly && !widget.readOnly} + clickable onClick={() => optionClickHandler(option)} {...tagProps} + disabled={false} + onDelete={readOnly || widget.readOnly ? undefined : onDelete} /> ); })