Unexpected scrollbar in KB Retrieval #22073

Closed
opened 2026-02-21 20:15:39 -05:00 by yindo · 3 comments
Owner

Originally created by @DavideDelbianco on GitHub (Feb 4, 2026).

Originally assigned to: @crazywoola on GitHub.

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.12.1

Cloud or Self Hosted

Cloud

Steps to reproduce

Add a KB Retrieval node
Choose a KB
Open the retrieval settings

Image Image

✔️ Expected Behavior

no scrollbar should appear

Actual Behavior

a scroll appears

Originally created by @DavideDelbianco on GitHub (Feb 4, 2026). Originally assigned to: @crazywoola on GitHub. ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.12.1 ### Cloud or Self Hosted Cloud ### Steps to reproduce Add a KB Retrieval node Choose a KB Open the retrieval settings <img width="492" height="573" alt="Image" src="https://github.com/user-attachments/assets/19884c53-273d-474d-beb7-bbeefe76d1b5" /> <img width="608" height="622" alt="Image" src="https://github.com/user-attachments/assets/d8ccf2a6-aa37-415a-993e-6f3b1951352e" /> ### ✔️ Expected Behavior no scrollbar should appear ### ❌ Actual Behavior a scroll appears
yindo added the 🐞 bugstatus: accepting prs labels 2026-02-21 20:15:39 -05:00
yindo closed this issue 2026-02-21 20:15:39 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 4, 2026):

The unexpected scrollbar in the KB Retrieval settings panel is caused by the PortalToFollowElem utility, which applies a maxHeight and overflowY: 'auto' style to the floating panel. This means a scrollbar will always appear if the content exceeds the available height, and currently, there are no props to customize or suppress this behavior directly in the component API (source).

As a temporary workaround, you can try overriding the styles at the usage site by passing a custom style prop to PortalToFollowElemContent, or by adding a global CSS rule targeting the floating panel to set overflow: hidden if you want to suppress the scrollbar. Similar CSS-based fixes have worked for other Dify UI overflow issues (example).

For a more robust solution, it would be beneficial for maintainers to expose overflowY and maxHeight as configurable props in PortalToFollowElem, so consumers can control scrollbar behavior as needed. This change would be backward-compatible and low-risk, since the utility currently has limited production usage.

If you notice the issue behaves differently across browsers or environments, sharing those details could help with debugging or prioritizing a fix.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Feb 4, 2026): <!-- Answer --> The unexpected scrollbar in the KB Retrieval settings panel is caused by the PortalToFollowElem utility, which applies a maxHeight and overflowY: 'auto' style to the floating panel. This means a scrollbar will always appear if the content exceeds the available height, and currently, there are no props to customize or suppress this behavior directly in the component API [(source)](https://github.com/langgenius/dify/blob/365f749ed5794da584154a63eafaab9587f31343/web/app/components/base/portal-to-follow-elem/index.tsx#L23-L196). As a temporary workaround, you can try overriding the styles at the usage site by passing a custom style prop to PortalToFollowElemContent, or by adding a global CSS rule targeting the floating panel to set `overflow: hidden` if you want to suppress the scrollbar. Similar CSS-based fixes have worked for other Dify UI overflow issues [(example)](https://github.com/langgenius/dify/issues/17343). For a more robust solution, it would be beneficial for maintainers to expose overflowY and maxHeight as configurable props in PortalToFollowElem, so consumers can control scrollbar behavior as needed. This change would be backward-compatible and low-risk, since the utility currently has limited production usage. If you notice the issue behaves differently across browsers or environments, sharing those details could help with debugging or prioritizing a fix. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/b535efcd-db4a-46e4-8385-f85e35508d52?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/b535efcd-db4a-46e4-8385-f85e35508d52?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/b535efcd-db4a-46e4-8385-f85e35508d52?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/b535efcd-db4a-46e4-8385-f85e35508d52?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b535efcd-db4a-46e4-8385-f85e35508d52?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/b535efcd-db4a-46e4-8385-f85e35508d52?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/b535efcd-db4a-46e4-8385-f85e35508d52?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20unexpected%20scrollbar%20in%20the%20KB%20Retrieval%20settings%20panel%20is%20caused%20by%20the%20PortalToFollowElem%20utility%2C%20which%20applies%20a%20maxHeight%20and%20overflowY%3A%20%27auto%27%20style%20to%20the%20floating%20panel.%20This%20means%20a%20scrollbar%20will%20always%20appear%20if%20the%20content%20exceeds%20the%20available%20height%2C%20and%20currently%2C%20there%20are%20no%20props%20to%20customize%20or%20suppress%20this%20behavior%20directly%20in%20the%20component%20API%20%5B%28source%29%5D%28https%3A//github.com/langgenius/dify/blob/365f749ed5794da584154a63eafaab9587f31343/web/app/components/base/portal-to-follow-elem/index.tsx%23L23-L196%29.%0A%0AAs%20a%20temporary%20workaround%2C%20you%20can%20try%20overriding%20the%20styles%20at%20the%20usage%20site%20by%20passing%20a%20custom%20style%20prop%20to%20PortalToFollowElemContent%2C%20or%20by%20adding%20a%20global%20CSS%20rule%20targeting%20the%20floating%20panel%20to%20set%20%60overflow%3A%20hidden%60%20if%20you%20want%20to%20suppress%20the%20scrollbar.%20Similar%20CSS-based%20fixes%20have%20worked%20for%20other%20Dify%20UI%20overflow%20issues%20%5B%28example%29%5D%28https%3A//github.com/langgenius/dify/issues/17343%29.%0A%0AFor%20a%20more%20robust%20solution%2C%20it%20would%20be%20beneficial%20for%20maintainers%20to%20expose%20overflowY%20and%20maxHeight%20as%20configurable%20props%20in%20PortalToFollowElem%2C%20so%20consumers%20can%20control%20scrollbar%20behavior%20as%20needed.%20This%20change%20would%20be%20backward-compatible%20and%20low-risk%2C%20since%20the%20utility%20currently%20has%20limited%20production%20usage.%0A%0AIf%20you%20notice%20the%20issue%20behaves%20differently%20across%20browsers%20or%20environments%2C%20sharing%20those%20details%20could%20help%20with%20debugging%20or%20prioritizing%20a%20fix.)&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/31954)
Author
Owner

@dosubot[bot] commented on GitHub (Feb 4, 2026):

The code for the KB Retrieval settings panel actually sets overflowY: 'auto' (not overflow: auto) on the floating panel via the PortalToFollowElem utility, specifically in the size middleware's apply function. This means only vertical scrolling should be enabled by default, and horizontal scrolling shouldn't occur unless a child element exceeds the panel's width or another style overrides it. You can see this in the code here: portal-to-follow-elem/index.tsx#L63-L71.

If you're seeing a horizontal scrollbar, it's likely due to a nested element with a width larger than the panel or an inherited style elsewhere. Inspecting the child elements or applying an explicit overflow-x: hidden style to the panel may help suppress the horizontal scrollbar.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Feb 4, 2026): <!-- Answer --> The code for the KB Retrieval settings panel actually sets overflowY: 'auto' (not overflow: auto) on the floating panel via the PortalToFollowElem utility, specifically in the size middleware's apply function. This means only vertical scrolling should be enabled by default, and horizontal scrolling shouldn't occur unless a child element exceeds the panel's width or another style overrides it. You can see this in the code here: [portal-to-follow-elem/index.tsx#L63-L71](https://github.com/langgenius/dify/blob/365f749ed5794da584154a63eafaab9587f31343/web/app/components/base/portal-to-follow-elem/index.tsx#L63-L71). If you're seeing a horizontal scrollbar, it's likely due to a nested element with a width larger than the panel or an inherited style elsewhere. Inspecting the child elements or applying an explicit overflow-x: hidden style to the panel may help suppress the horizontal scrollbar. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/1142f67a-8bdc-487a-97cd-c500da1746a5?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/1142f67a-8bdc-487a-97cd-c500da1746a5?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/1142f67a-8bdc-487a-97cd-c500da1746a5?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/1142f67a-8bdc-487a-97cd-c500da1746a5?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/1142f67a-8bdc-487a-97cd-c500da1746a5?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/1142f67a-8bdc-487a-97cd-c500da1746a5?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/1142f67a-8bdc-487a-97cd-c500da1746a5?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20code%20for%20the%20KB%20Retrieval%20settings%20panel%20actually%20sets%20overflowY%3A%20%27auto%27%20%28not%20overflow%3A%20auto%29%20on%20the%20floating%20panel%20via%20the%20PortalToFollowElem%20utility%2C%20specifically%20in%20the%20size%20middleware%27s%20apply%20function.%20This%20means%20only%20vertical%20scrolling%20should%20be%20enabled%20by%20default%2C%20and%20horizontal%20scrolling%20shouldn%27t%20occur%20unless%20a%20child%20element%20exceeds%20the%20panel%27s%20width%20or%20another%20style%20overrides%20it.%20You%20can%20see%20this%20in%20the%20code%20here%3A%20%5Bportal-to-follow-elem/index.tsx%23L63-L71%5D%28https%3A//github.com/langgenius/dify/blob/365f749ed5794da584154a63eafaab9587f31343/web/app/components/base/portal-to-follow-elem/index.tsx%23L63-L71%29.%0A%0AIf%20you%27re%20seeing%20a%20horizontal%20scrollbar%2C%20it%27s%20likely%20due%20to%20a%20nested%20element%20with%20a%20width%20larger%20than%20the%20panel%20or%20an%20inherited%20style%20elsewhere.%20Inspecting%20the%20child%20elements%20or%20applying%20an%20explicit%20overflow-x%3A%20hidden%20style%20to%20the%20panel%20may%20help%20suppress%20the%20horizontal%20scrollbar.)&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/31954)
Author
Owner

@DavideDelbianco commented on GitHub (Feb 6, 2026):

in previous version the floating ui portal did not have the overflow-y: auto
the issue is caused by the divider:

Image

coloring it in previous version make is more visible:

Image
@DavideDelbianco commented on GitHub (Feb 6, 2026): in previous version the floating ui portal did not have the overflow-y: auto the issue is caused by the divider: <img width="1049" height="645" alt="Image" src="https://github.com/user-attachments/assets/b7008189-524c-48f6-8fac-72936b45167e" /> coloring it in previous version make is more visible: <img width="1056" height="481" alt="Image" src="https://github.com/user-attachments/assets/597af8cd-cc99-4e00-aed5-d988abca7b70" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#22073