ng-multiselect-dropdown icon indicating copy to clipboard operation
ng-multiselect-dropdown copied to clipboard

The placeholder should show always even when we select a dropdown value

Open gopal1996 opened this issue 5 years ago • 2 comments
trafficstars

Angular version: 9.1.11

ng-multiselect-dropdown version: 0.2.10

Description of issue: When I select value input placeholder is changing to +1,2 based on how many I select. I want to hide the selected number. I want to show a default placeholder. image

Steps to reproduce: In ng-multiselect-dropdown setting object, set itemShowLimit: 0

Expected Result: image The placeholder should show always even when we select a dropdown value

Actual result: image

Demo: Please share sample code link using StackBlitz or codesandbox https://stackblitz.com/edit/angular-multiselect-dropdown-gjmk26 Any relevant code:

this.dropdownSettings = {
      singleSelection: false,
      idField: 'item_id',
      textField: 'item_text',
      selectAllText: 'Select All',
      unSelectAllText: 'UnSelect All',
      itemsShowLimit: 0,
      allowSearchFilter: true
    };

gopal1996 avatar Jul 17 '20 13:07 gopal1996

The below might not be the right solution but you can catch the node and remove like below in javascript. You can run the below in ngOninit also.

onSelectAll(items: any) { if ( document.getElementsByClassName('dropdown-multiselect__caret')[0] ) { const node = document.getElementsByClassName('dropdown-multiselect__caret')[0].parentNode.firstChild as HTMLElement node.remove(); }

}

DhineshKumar1203 avatar Feb 12 '21 17:02 DhineshKumar1203

Hello, I've been dealing with this issue for a few days now, didnt find an answer so i started digging in the directive's js files and inside of those (i think its like 5-6) files, there is a line in which the template is declared. I just simply replaced that template with a bit of changed code that removes the whole thing and sets placeholder active at all times.

I hope this answer can be at least a bit relevant, even tho im answering a bit late.

I inluded .txt file, didnt know how to share the code - putting it here would be just ugly

(I did it by simply ctrl+h on all files inside ng-multiselect-dropdown folde Howtosetplaceholder.txt r)

johnystecker avatar Nov 25 '21 10:11 johnystecker