From 707eba618363dc86dd763ddff7bc55deae893c7d Mon Sep 17 00:00:00 2001 From: Marcin Dziewulski Date: Thu, 25 Apr 2024 22:31:53 +0200 Subject: [PATCH] fix: pass node's data to the `on_select` callback --- lua/nui-components/select.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lua/nui-components/select.lua b/lua/nui-components/select.lua index 74c7279..518046b 100644 --- a/lua/nui-components/select.lua +++ b/lua/nui-components/select.lua @@ -127,12 +127,7 @@ function Select:actions() local tree = self:get_tree() local focused_node = self:get_focused_node() - local obj = { - id = focused_node.id, - text = focused_node.text, - value = focused_node.value, - } - + local obj = vim.deepcopy(focused_node) local is_selected_fn = pred_selected_fn(focused_node) if props.multiselect then