Skip to content

Conversation

chuoke
Copy link

@chuoke chuoke commented Feb 25, 2025

Types of changes

  • New feature
  • Bug fix
  • Enhancement
  • Component style change
  • Typescript definition change
  • Documentation change
  • Coding style change
  • Refactoring
  • Test cases
  • Continuous integration
  • Breaking change
  • Others

Background and context

In this case, the screen render is not normal in the sm or md screen. but it should inherit the xs value. However, the default value 24 is used.

<a-grid :cols="{ xs: 1, lg: 3 }" :colGap="12" :rowGap="12">
  <a-grid-item :span="1">
  </a-grid-item>
  <a-grid-item :span="{ xs: 1, lg: 2 }">
  </a-grid-item>
</a-grid>

image

Solution

Considering that modification of ResponsiveObserve may have a greater impact.
Simple to set callbackToXs to true.

How is the change tested?

No change.

Changelog

Component Changelog(CN) Changelog(EN) Related issues
Grid cols's callbackToXs 默认为 true cols's callbackToXs is true by default

Checklist:

  • Test suite passes (npm run test)
  • Provide changelog for relevant changes (e.g. bug fixes and new features) if applicable.
  • Changes are submitted to the appropriate branch (e.g. features should be submitted to feature branch and others
    should be submitted to main branch)

Other information

BTW, I think useResponsiveState fallbackToXs should be default true. However, I did not check other use cases.

Copy link

codesandbox bot commented Feb 25, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@ChenErik ChenErik mentioned this pull request Jun 27, 2025
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant