Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"top level" {{#if}} not allowed #161

Open
buschtoens opened this issue Nov 23, 2017 · 5 comments
Open

"top level" {{#if}} not allowed #161

buschtoens opened this issue Nov 23, 2017 · 5 comments

Comments

@buschtoens
Copy link

buschtoens commented Nov 23, 2017

I know this is a total edge-case, but I can't really work around it, so here goes: It is not possible to use a "top level" {{#if}} helper inside a vertical-collection.

{{!-- This is illegal... --}}
{{#vertical-collection items as |item i|}}
  {{#if renderAsParagraph}}
    <p>{{item}}</p>
  {{else}}
    <textarea>{{item}}</textarea>
  {{/if}}
{{/vertical-collection}}

{{!-- ...while this works. --}}
{{#vertical-collection items as |item i|}}
  <div>
    {{#if renderAsParagraph}}
      <p>{{item}}</p>
    {{else}}
      <textarea>{{item}}</textarea>
    {{/if}}
  </div>
{{/vertical-collection}}

Initially, all is well. But if you scroll a bit and then toggle renderAsParagraph, you get this error:

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

I stumbled upon this bug (?) while working on this PR: adopted-ember-addons/ember-light-table#514 (comment)

Do you see any chance of "fixing" this?

@buschtoens
Copy link
Author

My assumption is that Glimmer tries to update / remove parts of the DOM, that already have been destroyed by vertical-collection.

@simonihmig
Copy link

For the record: seems related to yapplabs/ember-wormhole#66

@pzuraq
Copy link
Contributor

pzuraq commented Nov 23, 2017

Yeah this is most likely due to the bounds of the component that’s being managed being manipulated in some weird way by Glimmer.

However, VC already does dom manipulation at a low level, so if we can figure out what’s going on here I think we can provide a fix 🙂 I’m not going to have time until after the holidays most likely, but if you’d like to give it a shot @buschtoens ping me on slack, can help guide you on it

@runspired
Copy link
Contributor

I believe the issue relates to us removing our own custom bounds.

buschtoens added a commit to adopted-ember-addons/ember-light-table that referenced this issue Nov 24, 2017
buschtoens added a commit to adopted-ember-addons/ember-light-table that referenced this issue Nov 24, 2017
@RobbieTheWagner
Copy link
Member

Does anyone have further insight into this issue or should we close as wontfix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants