druid icon indicating copy to clipboard operation
druid copied to clipboard

Deleted node error with rich text as a scrollable list item

Open NaakkaDev opened this issue 5 months ago • 2 comments

I have a data list with enough items for it to scroll. Each list item has one rich text, text node. This error happens only when I scroll the list and then close the game. I don't think this is critical, but certainly annoying.

I'm on Defold 1.10.3 and druid 1.1.4.

ERROR:SCRIPT: druid/custom/rich_text/rich_text.lua:169: Deleted node
stack traceback:
  [C]:-1: in function set_scale
  druid/custom/rich_text/rich_text.lua:169: in function on_remove
  druid/system/druid_instance.lua:233: in function final

NaakkaDev avatar Jul 13 '25 09:07 NaakkaDev

Thanks for the report!

Insality avatar Jul 13 '25 10:07 Insality

I had this error but I solved it. I was returning just widget.root instead of widget.root and widget in the add_item_callback. So I had

function M:init()
	self.prefab = self:get_node("prefab")
        gui.set_enabled(self.prefab, false)

	self.scroll = self.druid:new_scroll("scroll", "grid")
	self.grid = self.druid:new_grid("grid", "prefab")
	self.data_list = self.druid:new_data_list(self.scroll, self.grid, self.add_row_callback)
        -- other init things
end

-- called by data_list:add()
function M:add_row_callback(data, index)
	local new_row_widget = self.druid:new_widget(row_widget, "row", "root")

	return new_row_widget.root
end

and I changed the callback return to

return new_row_widget.root, new_row_widget

EnbyMonkey avatar Nov 09 '25 19:11 EnbyMonkey