Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangmm committed Dec 2, 2024
2 parents 9b153b6 + 32e3d3d commit 283d2d7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## [2.24.5](https://github.com/eeditiones/tei-publisher-components/compare/v2.24.4...v2.24.5) (2024-11-21)


### Bug Fixes

* **pb-combo-box:** Clear items before refetching ([b6fdf68](https://github.com/eeditiones/tei-publisher-components/commit/b6fdf68040484df01de23ee28f6461f525ce5423))

## [2.24.4](https://github.com/eeditiones/tei-publisher-components/compare/v2.24.3...v2.24.4) (2024-11-14)


### Bug Fixes

* **pb-table-grid:** respect existing search parameter when using included search feature ([7abdd8f](https://github.com/eeditiones/tei-publisher-components/commit/7abdd8fb67368f0a864a14354c98839e527dda94))

## [2.24.3](https://github.com/eeditiones/tei-publisher-components/compare/v2.24.2...v2.24.3) (2024-10-10)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teipublisher/pb-components",
"version": "2.24.3",
"version": "2.24.5",
"description": "Collection of webcomponents underlying TEI Publisher",
"repository": "https://github.com/eeditiones/tei-publisher-components.git",
"main": "index.html",
Expand Down
10 changes: 9 additions & 1 deletion src/pb-combo-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ export class PbComboBox extends pbMixin(LitElement) {
},
/**
* Preload all items from the remote data source at startup
* Must be of type string because tom-select supports setting
* that property to "focus" (load data on focus)
*/
preload: {
type: Boolean
type: String
},
/**
* Name of the event to be emitted when the user leaves the form control
Expand Down Expand Up @@ -160,6 +162,12 @@ export class PbComboBox extends pbMixin(LitElement) {
options.searchField = [];
options.preload = this.preload;
options.load = (query, callback) => {
if (this._select) {
// The default behaviour of tom-select is to keep existing items when loading
// again from the source. We want to show only items the server provides, so
// we need to clear "stale" items before fetching.
this._select.clearOptions();
}
fetch(`${url}?query=${encodeURIComponent(query)}`, {
method: 'GET',
mode: 'cors',
Expand Down

0 comments on commit 283d2d7

Please sign in to comment.