Topic: Configuration for mdb-material-chips

junior5417 pro asked 6 years ago


Hi, I've two question regarding MDB-Material-Chips.
  1. Can I include my own function checking when user pressed "ENTER".
  2. How do I include "onInput" on MDB-Material-Chips tag
Regards, Nic

Damian Gemza staff answered 6 years ago


Dear junior5417, What do you mean by pattern limitation? Do you want to place there a RegEx validation? If yes - you could try to add there your custom regex validation. But such feature is not available in our MDB Angular library. Best Regards, Damian

junior5417 pro answered 6 years ago


Hi Damian Thanks! It worked. Can I include pattern limitation to mdb-material-chips aswell?

Damian Gemza staff answered 6 years ago


Dear Nic, It's easy to achieve your desired functionalities. Just take a look at my code: HTML:
<mdb-material-chips [(ngModel)]="addtags" (keydown.enter)="onEnterPress()" (input)="onInput($event)" ></mdb-material-chips>
TS:
hideElement: boolean = true;

addtags:string[] = [];

onEnterPress() {

console.log('enter');

}

onInput(event:any) {

console.log(event.target.value);

}
Best Regards, Damian

Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Resolved

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 6.2.2
  • Device: Mac
  • Browser: Chrome
  • OS: OSX
  • Provided sample code: No
  • Provided link: No
Tags