Skip to content

Commit

Permalink
some formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
lenadax committed Nov 7, 2024
1 parent 64d6308 commit b52b4da
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions js/src/bootstrap5/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,23 @@ export class AutocompleteSuggestion extends BaseAutocompleteSuggestion {
this.elem = $('<div />')
.addClass('autocomplete-suggestion list-group-item')
.appendTo(this.widget.ul_elem);
$('<span />').text(this.value.substring(0, index)).appendTo(this.elem);
$('<strong />').text(this.value.substring(index, index + this.val.length)).appendTo(this.elem);
$('<span />').text(this.value.substring(index + this.val.length)).appendTo(this.elem);
$('<span />')
.text(this.value.substring(0, index))
.appendTo(this.elem);
$('<strong />')
.text(this.value.substring(index, index + this.val.length))
.appendTo(this.elem);
$('<span />')
.text(this.value.substring(index + this.val.length))
.appendTo(this.elem);
}
}

export class AutocompleteWidget extends BaseAutocomplete {

/**
* Initializes each widget in the given DOM context.
*
* @param {HTMLElement} context - DOM context for initialization.
*/
static initialize(context) {
Expand Down Expand Up @@ -89,7 +97,7 @@ export class AutocompleteWidget extends BaseAutocomplete {
////////////////////////////////////////////////////////////////////////////////

/**
* Re-initializes Ace editor on array add event.
* Re-initializes widget on array add event.
*/
function autocomplete_on_array_add(inst, context) {
AutocompleteWidget.initialize(context);
Expand Down

0 comments on commit b52b4da

Please sign in to comment.