From 71a6f6dfc7797b419b7ca9a10360f8657bd5b111 Mon Sep 17 00:00:00 2001
From: Volker Schukai <volker.schukai@schukai.com>
Date: Sun, 8 Jun 2025 00:58:54 +0200
Subject: [PATCH] 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.
---
 source/components/form/select.mjs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/source/components/form/select.mjs b/source/components/form/select.mjs
index 75c80c33c..59e23f9cc 100644
--- a/source/components/form/select.mjs
+++ b/source/components/form/select.mjs
@@ -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`
-- 
GitLab