diff --git a/components/anchor/anchorHelper.tsx b/components/anchor/anchorHelper.tsx index 0dcf732bb3..3092d058b4 100644 --- a/components/anchor/anchorHelper.tsx +++ b/components/anchor/anchorHelper.tsx @@ -55,7 +55,7 @@ export function scrollTo(href, target = getDefaultTarget) { } }; reqAnimFrame(frameFunc); - history.pushState(null, undefined, href); + history.pushState(null, '', href); } class AnchorHelper { diff --git a/components/transfer/index.tsx b/components/transfer/index.tsx index bfe71b227c..471b4ad0c3 100644 --- a/components/transfer/index.tsx +++ b/components/transfer/index.tsx @@ -233,12 +233,7 @@ export default class Transfer extends React.Component { handleSelect = (direction, selectedItem, checked) => { const { sourceSelectedKeys, targetSelectedKeys } = this.state; const holder = direction === 'left' ? [...sourceSelectedKeys] : [...targetSelectedKeys]; - let index; - holder.forEach((key, i) => { - if (key === selectedItem.key) { - index = i; - } - }); + const index = holder.indexOf(selectedItem.key); if (index > -1) { holder.splice(index, 1); } diff --git a/components/tree/demo/search.md b/components/tree/demo/search.md index 659e644cb9..80b147df08 100644 --- a/components/tree/demo/search.md +++ b/components/tree/demo/search.md @@ -111,13 +111,13 @@ class SearchTree extends React.Component { const index = item.key.search(searchValue); const beforeStr = item.key.substr(0, index); const afterStr = item.key.substr(index + searchValue.length); - const title = index > -1 ? - - {beforeStr} - {searchValue} - {afterStr} - - : {item.key}; + const title = index > -1 ? ( + + {beforeStr} + {searchValue} + {afterStr} + + ) : {item.key}; if (item.children) { return ( @@ -153,4 +153,4 @@ ReactDOM.render(, mountNode); color: #f50; transition: all .3s ease; } -```` \ No newline at end of file +````