Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Material chip constructor

Cesarino pro asked 5 years ago


<div class="container my-5">
  <div id="chips-autocomplete-test" class="chips chips-placeholder chips-autocomplete"</div>
</div>

$('#chips-autocomplete-test').materialChip({
    placeholder: 'Enter a tag',
    secondaryPlaceholder: '+Tag',
    data: [{tag: "tag 1"}]
});

Expected behavior

When I click the close button, I expect that the tag "tag 1" close.

Actual behavior

When I try to close the tag "tag 1", I have the following error:

Uncaught TypeError: Cannot read property 'data' of undefined

Tags created with the constructor are not closing

Resources (screenshots, code snippets etc.)


MDBootstrap staff answered 5 years ago


Hi! I tested your code and for me everything works fine. I tested it in our snippets: https://mdbootstrap.com/snippets/jquery/pjoter-2-0/769790

In this case your problem has to be triggered by something different in your project. If you need any help I am here for you.

Best Regards, Piotr



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.8.0
  • Device: Notebook
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No