From 4ddc3ece7d713633347f2702c30806b4a2e18ca4 Mon Sep 17 00:00:00 2001 From: Florrie Date: Wed, 4 Jul 2018 21:19:19 -0300 Subject: Remove FocusElement.isFocused, add isSelected FocusElement.isSelected behaves a little bit differently - basically it's true if the current selected element is that element, OR any of the ancestors of the current selected element is that element. It's also a getter, so you can't directly override it (assigning to el.isSelected won't work). --- ui/form/FocusBox.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui/form/FocusBox.js') diff --git a/ui/form/FocusBox.js b/ui/form/FocusBox.js index 51e961b..69b5bf5 100644 --- a/ui/form/FocusBox.js +++ b/ui/form/FocusBox.js @@ -19,13 +19,13 @@ module.exports = class FocusBox extends FocusElement { } drawTo(writable) { - if (this.isFocused) { + if (this.isSelected) { writable.write(ansi.invert()) } } didRenderTo(writable) { - if (this.isFocused) { + if (this.isSelected) { writable.write(ansi.resetAttributes()) } } -- cgit 1.3.0-6-gf8a5