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

Error adding new item to collapsible #144

Closed
albertoh opened this issue Jun 21, 2017 · 3 comments
Closed

Error adding new item to collapsible #144

albertoh opened this issue Jun 21, 2017 · 3 comments
Labels
Milestone

Comments

@albertoh
Copy link

albertoh commented Jun 21, 2017

Hi,
when I try to modify the items collection inside a collapsible, it is reporting an error

ERROR TypeError: Cannot read property 'insertBefore' of null
at MzCollectionItemComponent.MzRemoveComponentHost.ngAfterViewInit (remove-component-host.js:11)
at callProviderLifecycles (core.es5.js:11161)
at callElementProvidersLifecycles (core.es5.js:11136)
at callLifecycleHooksChildrenFirst (core.es5.js:11120)
at checkAndUpdateView (core.es5.js:12152)
at callViewAction (core.es5.js:12507)
at execEmbeddedViewsAction (core.es5.js:12465)
at checkAndUpdateView (core.es5.js:12145)
at callViewAction (core.es5.js:12507)
at execEmbeddedViewsAction (core.es5.js:12465)

My html template is:

<mz-collapsible [mode]="'expandable'" >
  <mz-collapsible-item [active]="true" >
    <mz-collapsible-item-header>
      <i mz-icon-mdi [icon]="'filter-variant'"></i>Filters <span class="app-brand-text text-lighten-2">x</span>
      <i mz-icon-mdi [icon]="'chevron-down'" [class]="'app-clean-mg'"></i>
      <i mz-icon-mdi [icon]="'chevron-left'" [class]="'app-clean-mg'"></i>
    </mz-collapsible-item-header>
    <mz-collapsible-item-body>
      <mz-collection>
        <ng-container>
          <mz-collection-item *ngFor="let f of filters">
            <span>{{'field.' + f.field | translate}}: {{f.value}}</span>
            <a (click)="remove(f)" mz-secondary-content>x</a>
          </mz-collection-item>
        </ng-container>
      </mz-collection>
    </mz-collapsible-item-body>
  </mz-collapsible-item>
</mz-collapsible>

where filters is an array of objects of type {field:xxx, value:xxx}
The error happens when filters array is modified.

Alberto

@jfcere
Copy link
Contributor

jfcere commented Jun 22, 2017

Hi @albertoh,

Thanks for reporting this issue, with your code sample we've been able to reproduce the issue. We will need to investigate further more and we'll keep you in touch.

@jfcere jfcere added the Bug label Jun 22, 2017
@jfcere jfcere added this to the 1.5.0 milestone Jun 22, 2017
@jfcere
Copy link
Contributor

jfcere commented Jun 22, 2017

@albertoh good news, it was faster than I thought!

DOM manipulation with mz-collection-item has been fixed and will be included in 1.5.0 release comin up next week or so.

collection-dom-manipulation

@albertoh
Copy link
Author

Thanks!

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

No branches or pull requests

3 participants