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] resizable table colums are too sensitive to drag #1762

Closed
1 task done
xuhen opened this issue Aug 14, 2023 · 11 comments
Closed
1 task done

[BUG] resizable table colums are too sensitive to drag #1762

xuhen opened this issue Aug 14, 2023 · 11 comments
Assignees

Comments

@xuhen
Copy link

xuhen commented Aug 14, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Which Component

table

Semi Version

2.39.3

Current Behavior

I have two fixed column at first and last column respectively, and every column have width property. when i put resizable to the table component, the drag handler appeard at header of each column. then I drag any handler moving a bit, but the width of
column change dramaticly which is hard to control.

Expected Behavior

when drag the handler, the width of column is smooth and easy to control.

Steps To Reproduce

No response

ReproducibleCode

<Table
        columns={columns}
        dataSource={data?.list}
        pagination={{
          className: "pagination",
          currentPage: data?.page,
          pageSize: data?.pageSize,
          total: data?.total,
          showSizeChanger: true,
          formatPageText: false,
        }}
        loading={loading}
        rowSelection={rowSelection as RowSelection<JobModel>}
        rowKey="id"
        onChange={handleTableChange as OnChange<JobModel>}
        scroll={scroll}
        resizable
      />

Environment

- OS: Mac Pro
- browser: Chrome (latest)

Anything else?

No response

@pointhalo
Copy link
Collaborator

Can you give us a reproduced screen recording or reproduced demo codesandbox?

@xuhen
Copy link
Author

xuhen commented Aug 14, 2023

https://codesandbox.io/s/async-smoke-ftscv5?file=/src/App.js

here you go :)

Draging the last two column are hard to control, but other column are fine relatively speaking.

@shijiatongxue
Copy link
Collaborator

better to not use fixed columns and resize at same time.

image

@shijiatongxue
Copy link
Collaborator

better to not use fixed columns and resize at same time.

image

or you can give one column without fixed width.

@xuhen
Copy link
Author

xuhen commented Aug 16, 2023

well, it make sense in our situation, the first column is checkbox; the last column is operating buttons, so we hope the two column will sitck around when the rest of columns scroll horizontally. however the content of several columns are too long, we want give it a default (say 200) width and user can drag to expand further. so I suppose it's resonable need to be fulfiled.

@xuhen
Copy link
Author

xuhen commented Aug 16, 2023

better to not use fixed columns and resize at same time.

image

Is it a bad idea to "automatically adjusted by the browser" when the width of one column are not set? cause we don't want the first and last fixed column to resize, however we do want to control the width of the two. or it's better to add resizable to specific column to control the drag functionality, the appearing of width property stay the same meaning instead of controling the resize functionality?

@xuhen
Copy link
Author

xuhen commented Aug 16, 2023

image

I attached a table to illustrate the situation here.

@shijiatongxue
Copy link
Collaborator

better to not use fixed columns and resize at same time.
image

Is it a bad idea to "automatically adjusted by the browser" when the width of one column are not set? cause we don't want the first and last fixed column to resize, however we do want to control the width of the two. or it's better to add resizable to specific column to control the drag functionality, then width stay the same?

Yes, it is. Fixed column and resizable column both need a fixed width at this moment.

For fixed column, a fixed width is ok. But for resizable column, which has a fixed width seems like make no sense.

We are considering untying resize functionality from fixed width.

image

@shijiatongxue shijiatongxue added Needs More Information Need more information, reproduce code and removed Needs More Information Need more information, reproduce code labels Aug 16, 2023
@xuhen
Copy link
Author

xuhen commented Aug 17, 2023

better to not use fixed columns and resize at same time.
image

Is it a bad idea to "automatically adjusted by the browser" when the width of one column are not set? cause we don't want the first and last fixed column to resize, however we do want to control the width of the two. or it's better to add resizable to specific column to control the drag functionality, then width stay the same?

Yes, it is. Fixed column and resizable column both need a fixed width at this moment.

For fixed column, a fixed width is ok. But for resizable column, which has a fixed width seems like make no sense.

We are considering untying resize functionality from fixed width.

image

really appreciate your reply :)

pointhalo added a commit that referenced this issue Aug 21, 2023
* feat: Table column add resize prop #1762

* docs: update Table resize demo

* chore: resolve conflict

---------

Co-authored-by: shijia.me <shijia.me@bytedance.com>
Co-authored-by: pointhalo <88709023+pointhalo@users.noreply.github.com>
@shijiatongxue
Copy link
Collaborator

We will support column.resize on next beta version.

You can set column.resize=false to disabeld resizable function of fixed column.

I think this issue can be closed. If you have any other question, feel free to leave a comment here.

@pointhalo
Copy link
Collaborator

release with v2.42.0-beta.0

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

No branches or pull requests

3 participants