Skip to content

Commit b448ded

Browse files
committed
fix Highlight component to support more flexible filters
1 parent cf47fea commit b448ded

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-datalist-input",
3-
"version": "3.0.0",
3+
"version": "3.0.1",
44
"description": "react-datalist-input provides a React datalist/combobox component called DatalistInput. The component contains an input field with a dropdown menu of suggestions based on the current input.",
55
"main": "dist/index.js",
66
"module": "dist/index.es.js",

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ const Highlight: React.FC<PropsWithChildren<HighlightProps>> = ({
376376
<>
377377
{children.substring(0, index)}
378378
{as === 'mark' ? (
379-
<mark {...props}>{children.substring(index, inputLength)}</mark>
379+
<mark {...props}>{children.substring(index, index + inputLength)}</mark>
380380
) : (
381381
<span {...props}>{children.substring(index, inputLength)}</span>
382382
)}

0 commit comments

Comments
 (0)