Skip to content

Commit

Permalink
修改 focusin handler 并重新打包代码。
Browse files Browse the repository at this point in the history
  • Loading branch information
TaoXuSheng committed Apr 12, 2018
1 parent c85d031 commit cd1d343
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@ function setFocusable (el) {
el.setAttribute('tabindex', -1)
}

function getNode (target) {
return els.find(el => el.contains(target) || el === target)
}

function focusinHandler ({ target }) {
const { el, nodeList } = findNodeMap(elMap.entries(), target) || {}
const node = getNode(target)
if (!node) return
const { el, nodeList } = findNodeMap(elMap.entries(), node) || {}
if (!el) return
clearTimeout(nodeList.timerId)
}

function focusoutHandler ({ target }) {
const node = els.find(el => el.contains(target) || el === target)
const node = getNode(target)
if (!node) return
const { el, key, nodeList } = findNodeMap(elMap.entries(), node) || {}
if (!el) return
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cd1d343

Please sign in to comment.