From 53c734c86d66c3bec6eb9473fb79a542f7f04d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Pumar?= Date: Tue, 19 Nov 2024 11:53:09 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20Fix=20highlight=20text=20(?= =?UTF-8?q?#5693)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix https://github.com/argilla-io/argilla/issues/5683 --- argilla-frontend/CHANGELOG.md | 4 ++++ .../useSpanAnnotationTextFieldViewModel.ts | 12 ++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/argilla-frontend/CHANGELOG.md b/argilla-frontend/CHANGELOG.md index e6f5aad8e0..e9b929b2cf 100644 --- a/argilla-frontend/CHANGELOG.md +++ b/argilla-frontend/CHANGELOG.md @@ -21,6 +21,10 @@ These are the section headers that we use: - Add a high-contrast theme & improvements for the forced-colors mode. ([#5661](https://github.com/argilla-io/argilla/pull/5661)) - Add English as the default language and add language selector in the user settings page. ([#5690](https://github.com/argilla-io/argilla/pull/5690)) +### Fixed + +- Fixed highlighting on same record ([#5693](https://github.com/argilla-io/argilla/pull/5693)) + ## [2.4.1](https://github.com/argilla-io/argilla/compare/v2.4.0...v2.4.1) ### Added diff --git a/argilla-frontend/components/features/annotation/container/fields/span-annotation/useSpanAnnotationTextFieldViewModel.ts b/argilla-frontend/components/features/annotation/container/fields/span-annotation/useSpanAnnotationTextFieldViewModel.ts index 98f63a9308..1342df139d 100644 --- a/argilla-frontend/components/features/annotation/container/fields/span-annotation/useSpanAnnotationTextFieldViewModel.ts +++ b/argilla-frontend/components/features/annotation/container/fields/span-annotation/useSpanAnnotationTextFieldViewModel.ts @@ -8,17 +8,13 @@ import { Question } from "~/v1/domain/entities/question/Question"; import { SpanQuestionAnswer } from "~/v1/domain/entities/question/QuestionAnswer"; import { SpanAnswer } from "~/v1/domain/entities/IAnswer"; -export const useSpanAnnotationTextFieldViewModel = ({ - name, - spanQuestion, - id, - searchText, -}: { +export const useSpanAnnotationTextFieldViewModel = (props: { name: string; spanQuestion: Question; id: string; searchText: string; }) => { + const { name, spanQuestion, id } = props; const searchTextHighlight = useSearchTextHighlight(name); const spanAnnotationSupported = ref(true); const answer = spanQuestion.answer as SpanQuestionAnswer; @@ -146,7 +142,7 @@ export const useSpanAnnotationTextFieldViewModel = ({ ); watch( - () => searchText, + () => props.searchText, (newValue) => { searchTextHighlight.highlightText(newValue); } @@ -161,7 +157,7 @@ export const useSpanAnnotationTextFieldViewModel = ({ spanAnnotationSupported.value = false; } - searchTextHighlight.highlightText(searchText); + searchTextHighlight.highlightText(props.searchText); }); onUnmounted(() => {