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

Add notes about avoiding Glimmer error under dynamic usages of auto-wrapping components #159

Conversation

andrewpye
Copy link
Member

At present, 4 of the components in ember-polaris auto-wrap their child elements in divs - polaris-button-group, polaris-form-layout, polaris-form-layout/group and polaris-stack. If any of these components are used with dynamic contents (e.g. with an if- or each-block inside), whenever an item is added or removed a Glimmer error can occur. Unfortunately I don't think we can detect this possibility and avoid it automatically (certainly not quickly), so I thought it was worth adding notes and examples to the docs for those components affected.

@andrewpye andrewpye self-assigned this Jul 10, 2018
@andrewpye andrewpye requested review from vladucu and tomnez July 10, 2018 13:41
Copy link
Contributor

@tomnez tomnez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call! Just one small typo I found, but other than that 💯

@@ -28,3 +28,23 @@ Form layout with two groups, the second of which is condensed:
{{/formLayout.group}}
{{/polaris-form-layout}}
```

For dynamic forms where items are added or removed once the form has rendered, you must explicitly a form layout item component around each item to prevent a Glimmer error such as `Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: you have "explicitly a form item" instead of "explicitly add a form item"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😱

Good catch, thanks 😄

@andrewpye
Copy link
Member Author

Gonna merge this down without making a release, since there are no code changes to go out and people probably read the docs online on here rather than from their app's node_modules directory 😉

@andrewpye andrewpye merged commit ef64dc6 into master Jul 10, 2018
@andrewpye andrewpye deleted the documentation/add-notes-about-glimmer-error-for-autowrapping-components branch July 10, 2018 14:14
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

Successfully merging this pull request may close these issues.

None yet

2 participants