mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix(frontend): resolve Nlu text selection bug
This commit is contained in:
@@ -210,12 +210,13 @@ const NlpDatasetSample: FC<NlpDatasetSampleProps> = ({
|
||||
keywordEntities={keywordEntities}
|
||||
patternEntities={patternEntities}
|
||||
placeholder={t("placeholder.nlp_sample_text")}
|
||||
onSelect={(selection, start, end) => {
|
||||
setSelection({
|
||||
value: selection,
|
||||
start,
|
||||
end,
|
||||
});
|
||||
onSelect={(newSelection, start, end) => {
|
||||
newSelection !== selection?.value &&
|
||||
setSelection({
|
||||
value: newSelection,
|
||||
start,
|
||||
end,
|
||||
});
|
||||
}}
|
||||
onChange={({ text, entities }) => {
|
||||
debounceSetText(text);
|
||||
@@ -322,9 +323,7 @@ const NlpDatasetSample: FC<NlpDatasetSampleProps> = ({
|
||||
</ContentItem>
|
||||
))}
|
||||
</Box>
|
||||
{
|
||||
/* Keyword entities */
|
||||
}
|
||||
{/* Keyword entities */}
|
||||
<Box display="flex" flexDirection="column">
|
||||
{keywordEntities.map((keywordEntity, index) => (
|
||||
<ContentItem
|
||||
|
||||
Reference in New Issue
Block a user