Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In "Create Knowledge Page," during Step One, the section overflows its parent container and does not shrink. #13760

Open
5 tasks done
tdawn0-0 opened this issue Feb 15, 2025 · 1 comment
Labels
🐞 bug Something isn't working

Comments

@tdawn0-0
Copy link

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

0.15.3

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

Open the 'Create Knowledge Page' and proceed to Step One. Reduce the browser window width. In Step One, the section overflows its parent container.
I've identified the issue, which seems to be that the container for the file-uploader component is fixed at 640px in width. I have already fixed this problem in my forked repository and am ready to submit a pull request whenever you're available.

✔️ Expected Behavior

The file-uploader component should scale properly with the browser dimensions.

❌ Actual Behavior

Image
This breaks the responsive layout of the page.

Copy link

dosubot bot commented Feb 15, 2025

Hello, @tdawn0-0! I'm here to help you with any bugs, questions, or contributions. Let's work together to resolve this issue.

To address the issue where the file-uploader component overflows its parent container during Step One, you can modify the CSS to ensure it fits within its container. The problem arises because the container is fixed at 640px in width. You can adjust the CSS to make the component responsive by using percentage-based widths or media queries.

Here's a suggested CSS modification:

/* index.module.css */
.fileUploaderContainer {
  width: 100%; /* Ensure the container takes full width of its parent */
  max-width: 640px; /* Set a maximum width */
  overflow: hidden; /* Prevent content from overflowing */
  box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

Apply this class to the container of the FileUploader component in the JSX:

<div className={s.fileUploaderContainer}>
  <FileUploader
    fileList={files}
    titleClassName={!shouldShowDataSourceTypeList ? 'mt-[30px] !mb-[44px] !text-lg !font-semibold !text-gray-900' : undefined}
    prepareFileList={updateFileList}
    onFileListUpdate={updateFileList}
    onFileUpdate={updateFile}
    onPreview={updateCurrentFile}
    notSupportBatchUpload={notSupportBatchUpload}
  />
</div>

This should help maintain the responsive layout by ensuring the file-uploader component does not exceed the boundaries of its parent container [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot dosubot bot added the 🐞 bug Something isn't working label Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant