mirror of
https://github.com/danog/react-datalist-input.git
synced 2024-12-02 17:37:50 +01:00
webpack cannot handel <>
This commit is contained in:
parent
299513ec7a
commit
897d8a8e42
@ -252,20 +252,20 @@ import React, {
|
|||||||
const index = indexOfMatch(currentInput, item);
|
const index = indexOfMatch(currentInput, item);
|
||||||
const inputLength = currentInput.length;
|
const inputLength = currentInput.length;
|
||||||
return (
|
return (
|
||||||
<>
|
<React.Fragment>
|
||||||
{ index >= 0 && inputLength
|
{ index >= 0 && inputLength
|
||||||
// renders label with matching search string marked
|
// renders label with matching search string marked
|
||||||
? (
|
? (
|
||||||
<>
|
<React.Fragment>
|
||||||
{item.label.substr(0, index) }
|
{item.label.substr(0, index) }
|
||||||
<strong>
|
<strong>
|
||||||
{ item.label.substr(index, inputLength) }
|
{ item.label.substr(index, inputLength) }
|
||||||
</strong>
|
</strong>
|
||||||
{ item.label.substr(index + inputLength, item.label.length) }
|
{ item.label.substr(index + inputLength, item.label.length) }
|
||||||
</>
|
</React.Fragment>
|
||||||
)
|
)
|
||||||
: item.label }
|
: item.label }
|
||||||
</>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}, [currentInput]);
|
}, [currentInput]);
|
||||||
|
|
||||||
|
@ -252,20 +252,20 @@ const DataListInput = ({
|
|||||||
const index = indexOfMatch(currentInput, item);
|
const index = indexOfMatch(currentInput, item);
|
||||||
const inputLength = currentInput.length;
|
const inputLength = currentInput.length;
|
||||||
return (
|
return (
|
||||||
<>
|
<React.Fragment>
|
||||||
{ index >= 0 && inputLength
|
{ index >= 0 && inputLength
|
||||||
// renders label with matching search string marked
|
// renders label with matching search string marked
|
||||||
? (
|
? (
|
||||||
<>
|
<React.Fragment>
|
||||||
{item.label.substr(0, index) }
|
{item.label.substr(0, index) }
|
||||||
<strong>
|
<strong>
|
||||||
{ item.label.substr(index, inputLength) }
|
{ item.label.substr(index, inputLength) }
|
||||||
</strong>
|
</strong>
|
||||||
{ item.label.substr(index + inputLength, item.label.length) }
|
{ item.label.substr(index + inputLength, item.label.length) }
|
||||||
</>
|
</React.Fragment>
|
||||||
)
|
)
|
||||||
: item.label }
|
: item.label }
|
||||||
</>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}, [currentInput]);
|
}, [currentInput]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user