Closed Capybara121 closed 1 week ago
Turns out the issue was that when an item has its position changed via bar_item_set_position, it never actually removes itself from the popup that it was added in, meaning that when you attempt to move it back it will not be able to be moved back due to the condition of popup_add_item not allowing an item to be added if the item already exists. Will be posting a PR shortly.
Not entirely sure whether this warrants a reopening of this issue or a new issue to be made, but I found some more potential problems as follows:
https://github.com/user-attachments/assets/022a0ebf-574b-4299-8656-daf2fb26545f
Description
When attempting to move items between different popup menus, items do not move back correctly (exact nature of behaviour unknown)
Code
test.lua
``` item1 = sbar.add("item","item1",{ popup = {drawing = true} }) item2 = sbar.add("item","item2",{ popup = {drawing = true} }) member1 = sbar.add("item","member1",{ label = "member1", position = "popup.item1" }) member2 = sbar.add("item","member2",{ label = "member2", position = "popup.item2" }) member1:set({position = "popup.item2"}) member1:set({position = "popup.item1"}) ```
Behaviour
Expected behaviour: Item should move to one menu, then move back to its original menu.
Actual behaviour: Item is moved to one menu and remains in said menu.