Skip to content

Commit 373fb12

Browse files
committed
fix span highlight wrong substring
1 parent 6fda58e commit 373fb12

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-datalist-input",
3-
"version": "3.2.0",
3+
"version": "3.2.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

+1-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ const Highlight: React.FC<PropsWithChildren<HighlightProps>> = ({
378378
{as === 'mark' ? (
379379
<mark {...props}>{children.substring(index, index + inputLength)}</mark>
380380
) : (
381-
<span {...props}>{children.substring(index, inputLength)}</span>
381+
<span {...props}>{children.substring(index, index + inputLength)}</span>
382382
)}
383383
{children.substring(index + inputLength, children.length)}
384384
</>

0 commit comments

Comments
 (0)