Topic: Multiple chips
Sekra24 pro asked 6 years ago
Hey guys,
I want to include 2 material-chip like this into one page:
HTML:
<div class="col">
<label><?php _e('Include keywords (Add with ENTER)', 'hypertheme');?></label>
<div class="chips filter-result-include chips-placeholder"></div>
</div>
<div class="col">
<label><?php _e('Exclude keywords (Add with ENTER)', 'hypertheme');?></label>
<div class="chips filter-result-exclude chips-placeholder"></div>
</div>
JAVASCRIPT:
$('.chips-placeholder.filter-result-include').material_chip({
placeholder: 'Add',
secondaryPlaceholder: '+Tag',
});
$('.chips-placeholder.filter-result-exclude').material_chip({
placeholder: 'Add',
secondaryPlaceholder: '+Tag',
});
Now I add a word into the include chip input. As soon as I type in the same keyword into the exclude material chip input it diapears immediately as soon as I hit enter.
But hold on it becomes more odd:
If I add a word into the exclude chip input, delete it and want to input the same word again it gets deleted immediately!
Add comment
Mikołaj Smoleński staff answered 6 years ago
Hi Sekra,
Please modify Your js code to look like this:
Regards
$('.chips-placeholder.filter-result-include').material_chip({
placeholder:'Add',
secondaryPlaceholder:'+Tag',
data: []
});
$('.chips-placeholder.filter-result-exclude').material_chip({
placeholder:'Add',
secondaryPlaceholder:'+Tag',
data2: []
});
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 jQuery
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No
Tags