[param-item] I don't understand the logic of setting min, max in the param-item component. #14378

Closed
opened 2026-02-21 19:16:59 -05:00 by yindo · 1 comment
Owner

Originally created by @yolofit on GitHub (Jun 3, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.4.1

Cloud or Self Hosted

Cloud

Steps to reproduce

When I take a value in the range [1,3], then max<5, the slider's parameter will be multiplied by 100. Is multiplying by 100 only necessary when max <=1?

The slider has a value override problem, but the input component doesn't have this logic, so it makes sense that the logic is consistent in both places.

Image

✔️ Expected Behavior

when min=1, max=3, slider can be used normally

Actual Behavior

when min=1, max=3, slider can not be used normally

Originally created by @yolofit on GitHub (Jun 3, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.4.1 ### Cloud or Self Hosted Cloud ### Steps to reproduce When I take a value in the range [1,3], then max<5, the slider's parameter will be multiplied by 100. Is multiplying by 100 only necessary when max <=1? The slider has a value override problem, but the input component doesn't have this logic, so it makes sense that the logic is consistent in both places. ![Image](https://github.com/user-attachments/assets/7a4d6117-bed9-4eac-9568-26d203ff1e90) ### ✔️ Expected Behavior when min=1, max=3, slider can be used normally ### ❌ Actual Behavior when min=1, max=3, slider can not be used normally
yindo closed this issue 2026-02-21 19:16:59 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 3, 2025):

Hi @yolofit! I'm Dosu and I’m helping the dify team.

The logic in the ParamItem component multiplies the slider's value, min, and max by 100 whenever max < 5. This was intended to provide finer granularity for sliders with small ranges, such as [0, 1]. However, this logic is too broad: it also affects ranges like [1, 3], which do not need this scaling and leads to the slider not working as expected in those cases. The InputNumber component does not use this scaling, which is why you see inconsistent behavior between the slider and input fields.

Multiplying by 100 is only necessary for cases where max <= 1 (for example, for decimal ranges like [0, 1]), not for integer ranges like [1, 3]. The current implementation over-applies this logic, causing the slider to malfunction when min=1 and max=3. Adjusting the condition to only multiply when max <= 1 would resolve this inconsistency and allow the slider to work normally for integer ranges like [1, 3] see code.

To reply, just mention my name @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jun 3, 2025): <!-- Greeting --> Hi @yolofit! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> The logic in the `ParamItem` component multiplies the slider's value, min, and max by 100 whenever `max < 5`. This was intended to provide finer granularity for sliders with small ranges, such as [0, 1]. However, this logic is too broad: it also affects ranges like [1, 3], which do not need this scaling and leads to the slider not working as expected in those cases. The `InputNumber` component does not use this scaling, which is why you see inconsistent behavior between the slider and input fields. Multiplying by 100 is only necessary for cases where `max <= 1` (for example, for decimal ranges like [0, 1]), not for integer ranges like [1, 3]. The current implementation over-applies this logic, causing the slider to malfunction when min=1 and max=3. Adjusting the condition to only multiply when `max <= 1` would resolve this inconsistency and allow the slider to work normally for integer ranges like [1, 3] [see code](https://github.com/langgenius/dify/blob/db83bfc53a77a93cf75de750a0f0941928364f78/web/app/components/base/param-item/index.tsx). <!-- Dosu Comment Footer --> *To reply, just mention my name [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/d3e7f51e-df9f-4fdf-8ee4-ba532011b2cb?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/d3e7f51e-df9f-4fdf-8ee4-ba532011b2cb?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/d3e7f51e-df9f-4fdf-8ee4-ba532011b2cb?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/d3e7f51e-df9f-4fdf-8ee4-ba532011b2cb?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/d3e7f51e-df9f-4fdf-8ee4-ba532011b2cb?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/d3e7f51e-df9f-4fdf-8ee4-ba532011b2cb?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/d3e7f51e-df9f-4fdf-8ee4-ba532011b2cb?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/20579)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#14378