victor-valencia / bootstrap-iconpicker

A simple icon picker
https://victor-valencia.github.com/bootstrap-iconpicker/
MIT License
377 stars 140 forks source link

setIcon function with Search filtered array ... "noIconClass" and data attributes for custom iconset #19

Open nikitul opened 9 years ago

nikitul commented 9 years ago
  1. In the first place, I try to set the iconPicker by javascript, using setIcon function.

If the iconPicker is filtered (with search box) and the desired icon is not in the filtered array, it will be selected the first icon from the filtered array.

I tried to reset the component (with reset function) before setting the new icon and it worked, but after that, if I use it like this 8-10 times, the whole webpage goes very slow (because of increased memory used by browser (IE) ).

.2. It would be a great thing to have a "noIconClass" (which could be defined by user) for the situation when we have no icon selected. For now, if no icon is selected, it will be selected the first icon from the array as default and this could be confusing. (Later i saw that USvER pointed the same thing, but I think it could be added by default)

.3. Setting a iconset via data attributes (role="iconpicker" ) is not working if is used a custom iconset (data-iconset="myIconset") even if this custom iconset object is loaded before bootstrap-iconpicker.min.js. Custom iconset could be used only in javascript.

Great Component by the way (in my opinion the best of his kind) Thank you!

havlicekdom commented 6 years ago

Problem number 1 is still present, even in the latest release. When I try to set icon to something not in the filtered array, the first icon from array is selected.

eformx commented 5 years ago

Solution is to clear the value (val)... $('.notify_icon').val('').iconpicker('setIcon', notify_icon);