Skip to content

Commit

Permalink
Use the disabled attribute to prevent default action
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Jun 8, 2016
1 parent b017187 commit e664510
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
.infinite-tree-item:hover {
background: #f2fdff;
}
.infinite-tree-item:disabled,
.infinite-tree-item[disabled] {
cursor: not-allowed;
opacity: 0.5;
}
.infinite-tree-node {
position: relative;
}
Expand Down
2 changes: 1 addition & 1 deletion src/infinite-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class InfiniteTree extends events.EventEmitter {
itemTarget = itemTarget.parentElement;
}

if (!itemTarget) {
if (!itemTarget || itemTarget.hasAttribute('disabled')) {
return;
}

Expand Down

0 comments on commit e664510

Please sign in to comment.