Browse Source

Fix regular error in firefox and safri

pull/13285/head
ztplz 6 years ago
committed by 偏右
parent
commit
e54b50cc01
  1. 2
      components/table/demo/custom-filter-panel.md

2
components/table/demo/custom-filter-panel.md

@ -84,7 +84,7 @@ class App extends React.Component {
const { searchText } = this.state; const { searchText } = this.state;
return searchText ? ( return searchText ? (
<span> <span>
{text.split(new RegExp(`(?<=${searchText})|(?=${searchText})`, 'i')).map((fragment, i) => ( {text.split(new RegExp(`(${searchText})`, 'gi')).map((fragment, i) => (
fragment.toLowerCase() === searchText.toLowerCase() fragment.toLowerCase() === searchText.toLowerCase()
? <span key={i} className="highlight">{fragment}</span> : fragment // eslint-disable-line ? <span key={i} className="highlight">{fragment}</span> : fragment // eslint-disable-line
))} ))}

Loading…
Cancel
Save