Skip to content

Commit

Permalink
fix span selection
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoala committed Nov 15, 2021
1 parent b274450 commit 0726cfd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h1>Demo</h1>
<div class="col-md-4">
<label for="validationTags" class="form-label">Tags</label>
<select class="form-select" id="validationTags" name="tags[]" multiple>
<option selected disabled hidden value="">Choose a tag...</option>
<option disabled hidden value="">Choose a tag...</option>
<option value="1" selected="selected">Apple</option>
<option value="2">Banana</option>
<option value="3">Orange</option>
Expand All @@ -31,7 +31,7 @@ <h1>Demo</h1>
<div class="col-md-4">
<label for="validationTagsClear" class="form-label">Tags (allow clear)</label>
<select class="form-select" id="validationTagsClear" name="tagsClear[]" multiple data-allow-clear="true">
<option selected disabled hidden value="">Choose a tag...</option>
<option disabled hidden value="">Choose a tag...</option>
<option value="1" selected="selected">Apple</option>
<option value="2">Banana</option>
<option value="3">Orange</option>
Expand All @@ -43,7 +43,7 @@ <h1>Demo</h1>
<div class="col-md-4">
<label for="validationTagsThreshold" class="form-label">Tags (allow clear + 0 threshold)</label>
<select class="form-select" id="validationTagsThreshold" name="tagsClearThreshold[]" multiple data-allow-clear="true" data-suggestions-threshold="0">
<option selected disabled hidden value="">Choose a tag...</option>
<option disabled hidden value="">Choose a tag...</option>
<option value="1" selected="selected">Apple</option>
<option value="2">Banana</option>
<option value="3">Orange</option>
Expand All @@ -55,7 +55,7 @@ <h1>Demo</h1>
<div class="col-md-4">
<label for="validationTagsShow" class="form-label">Tags (show all)</label>
<select class="form-select" id="validationTagsShow" name="tags_show[]" multiple data-show-all-suggestions="true">
<option selected disabled hidden value="">Choose a tag...</option>
<option disabled hidden value="">Choose a tag...</option>
<option value="1" selected="selected">Apple</option>
<option value="2">Banana</option>
<option value="3">Orange</option>
Expand All @@ -79,7 +79,7 @@ <h1>Demo</h1>
<div class="col-md-4">
<label for="validationTagsNew" class="form-label">Tags (allow new)</label>
<select class="form-select" id="validationTagsNew" name="tags_new[]" multiple data-allow-new="true">
<option selected disabled hidden value="">Choose a tag...</option>
<option disabled hidden value="">Choose a tag...</option>
<option value="1" selected="selected">Apple</option>
<option value="2">Banana</option>
<option value="3">Orange</option>
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ will be displayed in case of invalid tag.
```html
<label for="validationTags" class="form-label">Tags</label>
<select class="form-select" id="validationTags" name="tags[]" multiple>
<option selected disabled hidden value="">Choose a tag...</option>
<option disabled hidden value="">Choose a tag...</option>
<option value="1" selected="selected">Apple</option>
<option value="2">Banana</option>
<option value="3">Orange</option>
Expand Down
2 changes: 1 addition & 1 deletion tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ class Tags {
span.setAttribute(VALUE_ATTRIBUTE, value);

if (this.allowClear) {
html = '<span class="me-2" style="font-size:0.65em"><button type="button" class="btn-close btn-close-white" aria-label="' + this.clearLabel + '"></button></span>' + html;
html = '<button type="button" style="font-size:0.65em" class="me-2 btn-close btn-close-white" aria-label="' + this.clearLabel + '"></button>' + html;
}

span.innerHTML = html;
Expand Down

0 comments on commit 0726cfd

Please sign in to comment.