lekoala / bootstrap5-tags

Replace select[multiple] with nices badges for Bootstrap 5
MIT License
150 stars 35 forks source link

Added a few tweaks and fixes #74

Closed Dazzar56 closed 1 year ago

Dazzar56 commented 1 year ago

Hi, First of all, thank you for this component. Flexible and easy to modify, BS5 compatible , exactly what I looking for 👍 Although, I needed to make a few tweaks to accommodate it to my project. Maybe it will be usefull.

  1. Ported highlightTyped from your bootstrap5-autocomplete component. And now suggestion store label text in innerHTML to be able to render it.
  2. onRenderItem callback now change appirance only suggestion text but not the badge (maybe we need sepparte callback for these?)
  3. Fix adding/removal items, when it value contains invalid characters for HTML attributes: \' " = < > &.' . querySelector just didn't work in this case, so we have to search for value manually.
  4. added method POST support for fetch items.
  5. added showSuggestionsOnClick option. What I actualy need is dedicated arrow button to show suggestion regardless of suggestionsThreshold but this works just fine for now :)
  6. Unfortunately your latest change rendering of _selectElement brake render within input-group class -- select just place itself after tags div with 50% width. So I return previous variant, when hideNativeValidation is true. image

Please consider to add show suggestion button and some loading indicator for liveServer mode.

lekoala commented 1 year ago

@Dazzar56 wow a lot is going on there. i'm going to merge this as is and adjust a few things

lekoala commented 1 year ago

@Dazzar56 I've updated quite a lot of things on master following your pr: