Skip to content

Commit

Permalink
⚡️ Fix highlight text (#5693)
Browse files Browse the repository at this point in the history
Fix #5683
  • Loading branch information
damianpumar authored Nov 19, 2024
1 parent a9bf3df commit 53c734c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 4 additions & 0 deletions argilla-frontend/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -146,7 +142,7 @@ export const useSpanAnnotationTextFieldViewModel = ({
);

watch(
() => searchText,
() => props.searchText,
(newValue) => {
searchTextHighlight.highlightText(newValue);
}
Expand All @@ -161,7 +157,7 @@ export const useSpanAnnotationTextFieldViewModel = ({
spanAnnotationSupported.value = false;
}

searchTextHighlight.highlightText(searchText);
searchTextHighlight.highlightText(props.searchText);
});

onUnmounted(() => {
Expand Down

0 comments on commit 53c734c

Please sign in to comment.