Skip to content

Commit 23354e5

Browse files
committed
added isolate root element
1 parent 2b809cb commit 23354e5

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
%div{@tag_attributes.merge(class: "matestack-isolated-component-root")}
2+
=yield

app/concepts/matestack/ui/core/isolate/isolate.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ def show
4040

4141
# this method gets called when the isolate vuejs component requests isolated content
4242
def render_isolated_content
43-
render :children if authorized?
43+
if authorized?
44+
render :children_wrapper do
45+
render :children
46+
end
47+
end
4448
end
4549

4650
def authorized?

spec/test/components/dynamic/isolate/isolate_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ def response
7070

7171
visit "/example"
7272
# used on page
73-
expect(page).to have_xpath('//div[@id="page-div"]/div[@class="matestack-isolated-component-container"]/div[@class="matestack-isolated-component-wrapper"]/div[@class="some-isolated-component"]/span[@id="text" and contains(.,"some isolated compenent")]')
73+
expect(page).to have_xpath('//div[@id="page-div"]/div[@class="matestack-isolated-component-container"]/div[@class="matestack-isolated-component-wrapper"]/div[@class="matestack-isolated-component-root"]/div[@class="some-isolated-component"]/span[@id="text" and contains(.,"some isolated compenent")]')
7474

7575
# used on component
76-
expect(page).to have_xpath('//div[@id="page-div"]/div[@class="some-other-component"]/div[@class="matestack-isolated-component-container"]/div[@class="matestack-isolated-component-wrapper"]/div[@class="some-isolated-component"]/span[@id="text" and contains(.,"some isolated compenent")]')
76+
expect(page).to have_xpath('//div[@id="page-div"]/div[@class="some-other-component"]/div[@class="matestack-isolated-component-container"]/div[@class="matestack-isolated-component-wrapper"]/div[@class="matestack-isolated-component-root"]/div[@class="some-isolated-component"]/span[@id="text" and contains(.,"some isolated compenent")]')
7777

7878
end
7979

0 commit comments

Comments
 (0)