diff --git a/lib/widget.js b/lib/widget.js index 5ef443f..204600d 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -5540,7 +5540,7 @@ List.prototype.pick = function(label, callback) { self.hide(); self.screen.render(); if (!el) return callback(); - return callback(null, helpers.cleanTags(self.items[selected])); + return callback(null, helpers.cleanTags(self.ritems[selected])); }); }; @@ -9116,6 +9116,7 @@ helpers.attrToBinary = function(style, element) { }; helpers.cleanTags = function(text) { + if (!text) return text; return text .replace(/{(\/?)([\w\-,;!#]*)}/g, '') .replace(/\x1b\[[\d;]*m/g, '')