Chips instance cannot be found or used


Topic: Chips instance cannot be found or used

RossK1 pro premium priority asked a year ago

Expected behavior

When a chips component is instantiated on a DOM element, that chips instance can be found and referenced in JS to allow the chips to be queried, changed, disposed of, etc.

Actual behavior

A chips instance can be successfully instantiated, but querying the DOM for that instance later returns null.

Resources (screenshots, code snippets etc.)

The chips-initial example from the documentation has been modified in this snippet to show how it cannot be found even immediately after being created.

Can you please clarify how the chips object can be found/referenced after creation to allow for methods to be used and attributes to be queried?

Thank you!


kpienkowska staff answered a year ago

The getInstance method is not working properly right now. To access the chips instance you have to init your chips component via JS.

Example: https://mdbootstrap.com/snippets/standard/kpienkowska/5444659#js-tab-view


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: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 6.4.0
  • Device: PC
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: Yes