Fix composite widgets with top level container
When wrapping container widgets to create reusable composite widgets, `drill` will be called twice on the same widget definition. The first call happens within the wrapping function and applies the children widgets fine. The second call happens when the composite widget is used, but since there are no children widgets defined, the call to `set_children` sets the existing child to `nil` instead. Fixes #3213. Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
This commit is contained in:
parent
aba1cf398f
commit
7bc3ec4c35
|
@ -533,6 +533,7 @@ local function drill(ids, content)
|
|||
end
|
||||
end
|
||||
|
||||
if widgets and max > 0 then
|
||||
-- Add all widgets.
|
||||
for k = 1, max do
|
||||
-- ipairs cannot be used on sparse tables.
|
||||
|
@ -555,10 +556,11 @@ local function drill(ids, content)
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Replace all children (if any) with the new ones.
|
||||
if widgets then
|
||||
l:set_children(widgets)
|
||||
end
|
||||
|
||||
return l, id
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue