Skip to content

Commit

Permalink
Fix tree widget mouse handling
Browse files Browse the repository at this point in the history
Instead of only listening to `list.key()`, which ignores mouse-clicks,
we use the `list`s own select event to re-propagate the `tree`s select
event.
This way the mouse-clicks also trigger the `select`.
Since the existing `options.keys` are also passed to the `blessed.list()`
and thus influence its `select` event, they should behave exactly the
way they did til now.
  • Loading branch information
LinuCC committed May 3, 2018
1 parent e6c5870 commit e1f3995
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/widget/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function Tree(options) {

this.append(this.rows);

this.rows.key(options.keys, function() {
this.rows.on('select', function() {
var selectedNode = self.nodeLines[this.getItemIndex(this.selected)];
if (selectedNode.children) {
selectedNode.extended = !selectedNode.extended;
Expand Down

0 comments on commit e1f3995

Please sign in to comment.