;
}
diff --git a/packages/survey-vue3-ui/src/components/slider/SliderLabelItem.vue b/packages/survey-vue3-ui/src/components/slider/SliderLabelItem.vue
index 2d24489f68..0c8e625891 100644
--- a/packages/survey-vue3-ui/src/components/slider/SliderLabelItem.vue
+++ b/packages/survey-vue3-ui/src/components/slider/SliderLabelItem.vue
@@ -2,11 +2,22 @@
{question.handleLabelPointerUp(e, item.value )}">
-
-
+
+
+
+
+
+ {{item.value}}
+
+
+
+
diff --git a/packages/survey-vue3-ui/src/components/slider/slider.ts b/packages/survey-vue3-ui/src/components/slider/slider.ts
index 7a1c07768a..893aa3aa41 100644
--- a/packages/survey-vue3-ui/src/components/slider/slider.ts
+++ b/packages/survey-vue3-ui/src/components/slider/slider.ts
@@ -1,6 +1,6 @@
-import type { QuestionSliderModel, ItemValue } from "survey-core";
+import type { QuestionSliderModel, SliderLabelItemValue } from "survey-core";
export interface ISliderItemProps {
question: QuestionSliderModel;
- item: ItemValue;
+ item: SliderLabelItemValue;
}
diff --git a/screenshots/slider.spec.ts b/screenshots/slider.spec.ts
index 72847006e4..7d6e62d8f6 100644
--- a/screenshots/slider.spec.ts
+++ b/screenshots/slider.spec.ts
@@ -220,5 +220,45 @@ frameworks.forEach(framework => {
await compareScreenshot(page, ".sd-question", "slider-single-tooltips-always.png");
});
+ test("Slider: Custom Labels", async ({ page }) => {
+ const json = {
+ "elements": [
+ {
+ "type": "slider",
+ "name": "q1",
+ "customLabels": [
+ 0,
+ 20,
+ 40,
+ 60,
+ 80,
+ 100,
+ ]
+ }
+ ]
+ };
+ const question = new Question(page, "q1");
+ await page.setViewportSize({ width: 1920, height: 1080 });
+ await initSurvey(page, framework, json);
+
+ await compareScreenshot(page, ".sd-question", "slider-custom-labels.png");
+
+ await question.setPropertyValue("customLabels", [
+ { value: 0, text: "Lowest", showValue: true },
+ 20,
+ 40,
+ { value: 60, text: "Middle" },
+ 80,
+ { value: 100, text: " Highest", showValue: true },
+ ]);
+ await compareScreenshot(page, ".sd-question", "slider-custom-labels-secondary.png");
+
+ await question.setPropertyValue("readOnly", true);
+ await compareScreenshot(page, ".sd-question", "slider-custom-labels-secondary--read-only.png");
+
+ await new Survey(page).showPreview();
+ await compareScreenshot(page, ".sd-question", "slider-custom-labels-secondary--preview.png");
+ });
+
});
});
\ No newline at end of file
diff --git a/screenshots/slider.spec.ts-snapshots/slider-custom-labels-secondary--preview.png b/screenshots/slider.spec.ts-snapshots/slider-custom-labels-secondary--preview.png
new file mode 100644
index 0000000000..e15e0a0146
Binary files /dev/null and b/screenshots/slider.spec.ts-snapshots/slider-custom-labels-secondary--preview.png differ
diff --git a/screenshots/slider.spec.ts-snapshots/slider-custom-labels-secondary--read-only.png b/screenshots/slider.spec.ts-snapshots/slider-custom-labels-secondary--read-only.png
new file mode 100644
index 0000000000..80ba89db1d
Binary files /dev/null and b/screenshots/slider.spec.ts-snapshots/slider-custom-labels-secondary--read-only.png differ
diff --git a/screenshots/slider.spec.ts-snapshots/slider-custom-labels-secondary.png b/screenshots/slider.spec.ts-snapshots/slider-custom-labels-secondary.png
new file mode 100644
index 0000000000..bfcc27e50a
Binary files /dev/null and b/screenshots/slider.spec.ts-snapshots/slider-custom-labels-secondary.png differ
diff --git a/screenshots/slider.spec.ts-snapshots/slider-custom-labels.png b/screenshots/slider.spec.ts-snapshots/slider-custom-labels.png
new file mode 100644
index 0000000000..1163b366d3
Binary files /dev/null and b/screenshots/slider.spec.ts-snapshots/slider-custom-labels.png differ
diff --git a/tests/markup/etalon_slider.ts b/tests/markup/etalon_slider.ts
index e284433949..2bd4f3d597 100644
--- a/tests/markup/etalon_slider.ts
+++ b/tests/markup/etalon_slider.ts
@@ -92,6 +92,28 @@ registerMarkupTests(
},
snapshot: "slider-read-only-range-mode",
},
+ {
+ name: "Slider: Custom Labels",
+ json: {
+ questions: [
+ {
+ name: "name",
+ "type": "slider",
+ sliderType: "single",
+ titleLocation: "hidden",
+ "customLabels": [
+ { value: 0, text: "Lowest", showValue: true },
+ 20,
+ 40,
+ { value: 60, text: "Middle" },
+ 80,
+ { value: 100, text: " Highest", showValue: true },
+ ]
+ }
+ ]
+ },
+ snapshot: "slider-custom-labels",
+ },
// {
// name: "Slider: Error State: Single Mode",
// json: {
diff --git a/tests/markup/snapshots/slider-custom-labels.snap.html b/tests/markup/snapshots/slider-custom-labels.snap.html
new file mode 100644
index 0000000000..58e153abdc
--- /dev/null
+++ b/tests/markup/snapshots/slider-custom-labels.snap.html
@@ -0,0 +1,84 @@
+
\ No newline at end of file
diff --git a/tests/markup/snapshots/slider-default-value-range-mode.snap.html b/tests/markup/snapshots/slider-default-value-range-mode.snap.html
index ae37ab2014..fb888c480e 100644
--- a/tests/markup/snapshots/slider-default-value-range-mode.snap.html
+++ b/tests/markup/snapshots/slider-default-value-range-mode.snap.html
@@ -39,43 +39,55 @@
-
-
-
-
-
diff --git a/tests/markup/snapshots/slider-default-value-single-mode.snap.html b/tests/markup/snapshots/slider-default-value-single-mode.snap.html
index b03261b567..6f3f8f5f52 100644
--- a/tests/markup/snapshots/slider-default-value-single-mode.snap.html
+++ b/tests/markup/snapshots/slider-default-value-single-mode.snap.html
@@ -26,43 +26,55 @@
-
-
-
-
-
diff --git a/tests/markup/snapshots/slider-range-mode.snap.html b/tests/markup/snapshots/slider-range-mode.snap.html
index e50599354f..ad2d95cdb9 100644
--- a/tests/markup/snapshots/slider-range-mode.snap.html
+++ b/tests/markup/snapshots/slider-range-mode.snap.html
@@ -39,43 +39,55 @@
-
-
-
-
-
diff --git a/tests/markup/snapshots/slider-read-only-range-mode.snap.html b/tests/markup/snapshots/slider-read-only-range-mode.snap.html
index ae37ab2014..fb888c480e 100644
--- a/tests/markup/snapshots/slider-read-only-range-mode.snap.html
+++ b/tests/markup/snapshots/slider-read-only-range-mode.snap.html
@@ -39,43 +39,55 @@
-
-
-
-
-
diff --git a/tests/markup/snapshots/slider-read-only-single-mode.snap.html b/tests/markup/snapshots/slider-read-only-single-mode.snap.html
index b03261b567..6f3f8f5f52 100644
--- a/tests/markup/snapshots/slider-read-only-single-mode.snap.html
+++ b/tests/markup/snapshots/slider-read-only-single-mode.snap.html
@@ -26,43 +26,55 @@
-
-
-
-
-
diff --git a/tests/markup/snapshots/slider-single-mode.snap.html b/tests/markup/snapshots/slider-single-mode.snap.html
index f5535e50ba..77882e97d6 100644
--- a/tests/markup/snapshots/slider-single-mode.snap.html
+++ b/tests/markup/snapshots/slider-single-mode.snap.html
@@ -26,43 +26,55 @@