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

[Bug] Layout Sider ignoring theme token's breakpoints #48884

Open
fribbels opened this issue May 12, 2024 · 5 comments
Open

[Bug] Layout Sider ignoring theme token's breakpoints #48884

fribbels opened this issue May 12, 2024 · 5 comments

Comments

@fribbels
Copy link

Reproduction link

Edit on StackBlitz

Steps to reproduce

Drag to change the editor/demo screen size
Drag until the width is 1300, nothing happens

What is expected?

I expected that the layout 'lg' breakpoint follows the 1300px in the custom tokens defined in the ConfigProvider

<ConfigProvider
  theme={{
    token: {
      screenLG: 1300,
      screenLGMin: 200,
      screenLGMax: 1300,
    },
  }}
>

What is actually happening?

The layout ignores the 1300px defined and defaults to 992px. When dragging to 992px the layout then correctly shrinks. However it should be shrinking at 1300px not 992px.

Environment Info
antd 5.17.0
React 18.3.1
System Windows 11
Browser Chrome
Copy link

stackblitz bot commented May 12, 2024

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@fribbels
Copy link
Author

2024-05-11.20-23-30.mp4

Example video - The window starts at 1307px -> doesn't change at 1300px -> changes at 992px

@MadCcc
Copy link
Member

MadCcc commented May 15, 2024

Refer to the default value of antd, screenLGMin should be the same as screenLG and screenLGMax should be larger than screenLG

@fribbels
Copy link
Author

2024-05-15.12-37-30.mp4

https://stackblitz.com/edit/react-cmczs9-znoxlu?file=demo.tsx

Refer to the default value of antd, screenLGMin should be the same as screenLG and screenLGMax should be larger than screenLG

@MadCcc thanks for taking a look. See new video and the new sample code with adjusted values - I've changed screenLGMin == screenLG == 1300, and screenLGMax == 1500 to be > screenLG as suggested.

The issue is still present, and the behavior did not change. The layout ignores the 1300px breakpoint that I've defined in config, and only uses the default 992px.

@fribbels
Copy link
Author

Hi, just checking in as its been two weeks, I'm still experiencing this issue.

See repro at: https://stackblitz.com/edit/react-cmczs9-znoxlu?file=demo.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants