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

[Resizable] 拖动中间块时,中间块的移动方向跟鼠标方向相反 #2540

Open
xggz opened this issue Oct 23, 2024 · 1 comment
Open
Labels
feature request Request new feature

Comments

@xggz
Copy link

xggz commented Oct 23, 2024

Which Component Need Enhancement 期望新增功能的组件

  • Resizable

Feature Description 功能描述

鼠标按住中间块,向左拖动时,中间块是向右移动的,向右拖动时,中间块向左移动,都是相反方向。

另外能否支持设置一个ResizeItem的defaultSize,另外一个自动剩余宽度(我的场景时这样的,一个ResizeItem默认设置的是px单位,另外一个ResizeItem就不好设置defaultSize属性了,但是不设置的话,它也没有自动占用剩余的所有空间)。

Code 代码

export const DocumentIndex = () => {
  return (
    <ResizeGroup direction='horizontal'>
      <ResizeItem defaultSize="20%" min="180px" max="50%">
        <DocumentSider />
      </ResizeItem>
      <ResizeHandler></ResizeHandler>
      <ResizeItem defaultSize="80%">
        <DocumentContent />
      </ResizeItem>
    </ResizeGroup>
  )
}
@xggz xggz added the feature request Request new feature label Oct 23, 2024
@Nathon2Y
Copy link
Contributor

提到的这两个功能点在官网文档是正常的,目前出现这个bug的原因是react StrictMode下会将context中hook执行两次,导致在开发模式下组件的表现不符合预期,可以先在非严格模式下开发,相关问题后续修复

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

No branches or pull requests

2 participants