react-data-grid icon indicating copy to clipboard operation
react-data-grid copied to clipboard

Draggable and Resizable columns Visually expands width to a max limit and then starts to resize.

Open madhan-dhamodaran opened this issue 8 years ago • 17 comments

  • Have you already searched for similar issues? Please help us out and double-check first!

  • Also, please don't be that person who deletes this template. It's here for a reason.

  • Thanks!


Which version of React JS are you using?

✅ Officially supported ✅

  • [ ] v15.4.x

⚠️ Not officially supported, expect warnings ⚠️

  • [ ] v15.5.x
  • [ ] v15.6.x

☣️ Not officially supported, expect warnings and errors ☣️

  • [x] v16.x.x

Which browser are you using?

✅ Officially supported ✅

  • [x] IE 9 / IE 10 / IE 11
  • [ ] Edge
  • [x] Chrome

⚠️ Not officially supported, but "should work" ⚠️

  • [ ] Firefox
  • [ ] Safari

I'm submitting a ...

  • [x] 🐛 Bug Report
  • [ ] 💡 Feature Request

👋 Need general support? Not sure about how to use React itself, or how to get started with the Grid? Please do not submit support request here. Instead see

https://github.com/adazzle/react-data-grid/blob/master/CONTRIBUTING.md


Issue Details

Please include:
- What the current behavior is
          Draggable and Resizable columns Visually expands width to a max limit and then starts to resize.
- What the desired behvaior is
           While resizing both draggable and resizable columns, it shouldn't modify the width of the column. It should change the width as we are resizing the column.
- (If Bug) Steps to reproduce the issue
            Define you column with a fixed width and set Draggable: true and resizable: true. 
            Now, click on the right edge of the column and start dragging.
            You will see the width expands to the right most and then starts to resize as you resize the 
            column.
            Please see attached video.
- (If Feature) The motivation / use case for the feature

We especially love screenshots / videos of problems, and remember
The Best Issue Is A Pull Request™

madhan-dhamodaran avatar Nov 27 '18 17:11 madhan-dhamodaran

@amanmahajan7 @tenpaiyomi @jpdriver , @malonecj

Please find an onscreen recording. https://www.useloom.com/share/2026ac6326ca47229c88228b07c11b07

madhan-dhamodaran avatar Nov 27 '18 17:11 madhan-dhamodaran

It needs to be investigated. It seems like an issue related to column width and size calculation

https://github.com/adazzle/react-data-grid/blob/master/packages/react-data-grid/src/HeaderCell.js#L58

amanmahajan7 avatar Dec 03 '18 20:12 amanmahajan7

@amanmahajan7 , I just tried a fixed and it works.

Like you said in HeaderCell.js

const left = ReactDOM.findDOMNode(this).getBoundingClientRect().left;

in reactJS documentation, they say not to use findDOMNode. If you set a column to Draggable, it gets wrapped inside a div with width:0. So, when it looks for .left(), it gives a wrong value.

So, I replaced it with this.

const left = document.getElementsByClassName('react-grid-HeaderCell--resizing')[0].getBoundingClientRect().left;

It looks good. Please feel free Share your comments.

madhan-dhamodaran avatar Dec 03 '18 20:12 madhan-dhamodaran

@madhan-dhamodaran see this https://github.com/adazzle/react-data-grid/pull/1414/files

qili26 avatar Dec 04 '18 15:12 qili26

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please reopen this if you feel it has been incorrectly closed and we will do our best to look into it. Thank you for your contributions.

stale[bot] avatar Jan 03 '19 15:01 stale[bot]

I have the fix for this and I will raise a PR as part of my other issues

madhan-dhamodaran avatar Jan 03 '19 20:01 madhan-dhamodaran

I have raised a PR for this. Awaiting merge. #1449

madhan-dhamodaran avatar Jan 28 '19 15:01 madhan-dhamodaran

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please reopen this if you feel it has been incorrectly closed and we will do our best to look into it. Thank you for your contributions.

stale[bot] avatar Feb 27 '19 16:02 stale[bot]

I have raised a PR for this. Awaiting merge. #1449

madhan-dhamodaran avatar Feb 27 '19 16:02 madhan-dhamodaran

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please reopen this if you feel it has been incorrectly closed and we will do our best to look into it. Thank you for your contributions.

stale[bot] avatar Mar 29 '19 17:03 stale[bot]

I have raised a PR for this. Awaiting merge. #1449

madhan-dhamodaran avatar Mar 29 '19 17:03 madhan-dhamodaran

Any updates?

iatacs19 avatar Apr 23 '19 20:04 iatacs19

I have opened a new PR for this which implements the same change as @madhan-dhamodaran but separated into one PR. @amanmahajan7 has indicated in #1449 that if this was separated off, it could be approved.

ghost avatar May 16 '19 20:05 ghost

I am running into this issue as well. In what version will this be fixed?

john-fowler avatar Jun 26 '19 18:06 john-fowler

@john-fowler They are not going to be fixing this. They are working on the next version. If you look at the discussion on my PR, here, he explains more. If you need to fix this for yourself, you can fork and use the fix in this commit, here

ghost avatar Jun 26 '19 18:06 ghost

This is fixed in v7 canary

https://github.com/adazzle/react-data-grid/blob/canary/CHANGELOG.md https://adazzle.github.io/react-data-grid/canary/?path=/story/demos--columns-reordering https://github.com/adazzle/react-data-grid/blob/canary/stories/demos/ColumnsReordering.tsx

amanmahajan7 avatar Apr 29 '20 15:04 amanmahajan7

@amanmahajan7 Have you guys established any timetables for v7 beta and GA? We'd love to upgrade, but can't use a canary version in production.

Are you managing a public task list anywhere that I could contribute to?

mklosterboer avatar Apr 29 '20 15:04 mklosterboer