Skip to content

Commit aa3a4b4

Browse files
committed
Element#inner_dom: Reduce flickering - first build tree, then insert it
1 parent 388c502 commit aa3a4b4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

opal/browser/dom/element.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,8 @@ def id=(value)
354354

355355
# Set the inner DOM of the element using the {Builder}.
356356
def inner_dom(builder=nil, &block)
357-
clear
358-
359-
self << Builder.new(document, builder, &block).to_a
357+
self.inner_dom = Builder.new(document, builder, &block).to_a
358+
self
360359
end
361360

362361
# Set the inner DOM with the given node.

0 commit comments

Comments
 (0)