Skip to content

Commit

Permalink
docs: fix table custom search panel demo
Browse files Browse the repository at this point in the history
  • Loading branch information
yesmeck committed May 15, 2018
1 parent 6045849 commit 78af67a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/table/demo/custom-filter-panel.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const data = [{
address: 'Sidney No. 1 Lake Park',
}, {
key: '4',
name: 'Jim Red',
name: 'Jim Redjim',
age: 32,
address: 'London No. 2 Lake Park',
}];
Expand Down Expand Up @@ -63,8 +63,9 @@ class App extends React.Component {
...record,
name: (
<span>
{record.name.split(reg).map((text, i) => (
i > 0 ? [<span className="highlight">{match[0]}</span>, text] : text
{record.name.split(new RegExp(`(?<=${searchText})|(?=${searchText})`, 'i')).map((text, i) => (
text.toLowerCase() === searchText.toLowerCase() ?
<span key={i} className="highlight">{text}</span> : text // eslint-disable-line
))}
</span>
),
Expand Down

0 comments on commit 78af67a

Please sign in to comment.