Skip to content
Snippets Groups Projects
Verified Commit 71a6f6df authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix: Remove unused property and improve option fetching in select component

- Removed the `remoteInfo.path` property from the Select class documentation and its initialization as it was never utilized, keeping the codebase clean and less confusing.
- Enhanced the `fetch` call in the `initTotal` function to include `fetchOptions`, allowing for more flexible and controlled fetching behavior based on user-defined options. This improves the functionality when interacting with remote data sources.

These changes streamline the select component's code and enhance data fetching capabilities.
parent 7e6d1218
No related branches found
No related tags found
No related merge requests found
......@@ -417,7 +417,6 @@ class Select extends CustomControl {
* @property {boolean} features.useStrictValueComparison Use strict (`===`) comparison when matching option values.
* @property {boolean} features.showRemoteInfo When the filter mode is set to "remote," display a badge indicating the possibility of additional remote options.
* @property {Object} remoteInfo Configuration for remote info badge.
* @property {string} remoteInfo.path Path to the remote info badge.
* @property {string} remoteInfo.url URL for total count of options when `filter.mode==="remote"` is set.
* @property {Object} placeholder Placeholder text for the control.
* @property {string} placeholder.filter Placeholder text for filter input.
......@@ -474,7 +473,6 @@ class Select extends CustomControl {
url: null,
remoteInfo: {
path: null,
url: null,
},
......@@ -3035,8 +3033,10 @@ function initTotal() {
return;
}
const fetchOptions = this.getOption("fetch", {});
getGlobal()
.fetch(url)
.fetch(url, fetchOptions)
.then((response) => {
if (!response.ok) {
// Improved status checking using `response.ok`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment