ember-tether icon indicating copy to clipboard operation
ember-tether copied to clipboard

Breaks with glimmer (ember 2.10.0) when you don't have a single child element

Open luxzeitlos opened this issue 8 years ago • 5 comments

I have a ember-tether inside an {{#if}} that contains a {{link-to}}. The following breaks:

  • make the if evaluate to true
  • click the {{link-to}}
  • make the if evaluate to false

I get this error:

Uncaught NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

luxzeitlos avatar Sep 09 '16 13:09 luxzeitlos

I have the problem too, if I can get a pointer where to look, I can help. Any ideas where to start?

juggy avatar Oct 14 '16 23:10 juggy

Okay, I think its far simpler. If the tether is inside an {{#if}} it breaks :/

luxzeitlos avatar Nov 30 '16 22:11 luxzeitlos

Workaround for now:

Replace this:

{{#if show}}
  {{#ember-tether ...}}...{{/ember-tether}}
{{/if}}

with this:

{{#if show}}
  <div>
  {{#ember-tether ...}}...{{/ember-tether}}
  </div>
{{/if}}

Thanks to this post.

luxzeitlos avatar Nov 30 '16 22:11 luxzeitlos

I believe this issue might be solvable using the -in-element helper, which we're using over in ember-popper. It allows you to tell Glimmer to render the block to the target element, so you can render it directly to wherever the Tether would have been appended (body, #ember-application, etc) and Tether won't end up actually moving the element, so Glimmer will know how to remove it later.

pzuraq avatar May 12 '17 22:05 pzuraq

@pzuraq is your suggestion that the -in-element helper be used without Tether, or can you see them being used in parallel? I am a bit unsure as to how I might go about this.

bstro avatar Mar 09 '18 23:03 bstro