Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(web): avoid prehydration script in slider (#34676)

yyh909c062ee178
diff --git a/web/app/components/base/ui/slider/__tests__/index.spec.tsx b/web/app/components/base/ui/slider/__tests__/index.spec.tsx
index f34de5010d3..4026b7f13b0 100644
--- a/web/app/components/base/ui/slider/__tests__/index.spec.tsx
+++ b/web/app/components/base/ui/slider/__tests__/index.spec.tsx
@@ -70,4 +70,10 @@ describe('Slider', () => {
const sliderWrapper = container.querySelector('.outer-test')
expect(sliderWrapper).toBeInTheDocument()
})
+
+ it('should not render prehydration script tags', () => {
+ const { container } = render(<Slider value={10} onValueChange={vi.fn()} aria-label="Value" />)
+
+ expect(container.querySelector('script')).not.toBeInTheDocument()
+ })
})
diff --git a/web/app/components/base/ui/slider/index.tsx b/web/app/components/base/ui/slider/index.tsx
index b514767c2d1..9470e7051d7 100644
--- a/web/app/components/base/ui/slider/index.tsx
+++ b/web/app/components/base/ui/slider/index.tsx
@@ -82,7 +82,7 @@ export function Slider({
step={step}
disabled={disabled}
name={name}
- thumbAlignment="edge"
+ thumbAlignment="edge-client-only"
className={cn(sliderRootClassName, className)}
>
<BaseSlider.Control className={sliderControlClassName}>