How to unmount the poopup onsubmit/onclose? #25
-
Hey, I noticed that after I call Should the popup be unmounted after submit/cancel calls? What to do when the popup needs to be opened/closed multiple times in the same buffer? Appreciate any help. This is the code I'm using local Menu = require("nui.menu")
local menu = Menu({
relative = "cursor",
border = {
style = "rounded",
highlight = "Normal",
text = {
top = "Delete react package",
top_align = "left",
},
},
position = {
row = 0,
col = 0,
},
size = {
width = 50,
height = 2,
},
highlight = "Normal:Normal",
focusable = true,
}, {
lines = {
Menu.item("Confirm"),
Menu.item("Cancel"),
},
keymap = {
focus_next = { "j", "<Down>", "<Tab>" },
focus_prev = { "k", "<Up>", "<S-Tab>" },
close = { "<Esc>", "<C-c>" },
submit = { "<CR>", "<Space>" },
},
on_close = function()
print("CLOSED")
end,
on_submit = function(item)
print("SUBMITTED", vim.inspect(item))
end,
})
M.delete = function()
menu:mount()
end |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello @vuki656 , thanks for trying it out.
That is definitely a bug in the underlying |
Beta Was this translation helpful? Give feedback.
Hello @vuki656 , thanks for trying it out.
That is definitely a bug in the underlying
Popup
component. Can you confirm if #27 fixes this issue for you?