Material chip constructor


Topic: Material chip constructor

Cesarino pro asked 6 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 pro premium priority answered 6 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
  • User: 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
Tags