-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
fix: draggable resizing col jumps to right #1421
Conversation
const right = e.pageX || (e.touches && e.touches[0] && e.touches[0].pageX) || (e.changedTouches && e.changedTouches[e.changedTouches.length - 1].pageX); | ||
// if headerDom is a draggable div, the first element (which is the only element as well) is the actual column header div with the position info | ||
const headerDom = ReactDOM.findDOMNode(this); | ||
const left = headerDom.draggable ? headerDom.firstChild.getBoundingClientRect().left : headerDom.getBoundingClientRect().left; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I understand, we need to access the cell. Is that correct? In yes then I think we should add a ref to the div and just use it directly. Another benefit is that React.findDOMNode
will be deprecated soon so it preferred not to use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, in brief, we should get the actual cell position, I will make this update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Let's wait for one more review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need a ref
for this? I feel like using e.target.parentNode
should be enough to get the cell's div
.
@MayhemYDG this makes sense but recently we have moved around a lot for components to fix a few issues and this may break the parent/child assumption. I would like to revisit HeaderCell code again so we can improve the composition something like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me.
* Cell Tooltip - Focus Issues (#1422) * change level tooltip gets rendered and level it gets triggered * remove unsed editors and fix imports. * re order inclusion of frozen cells to avoid z-index css. * address comments * Revert "remove unsed editors and fix imports." This reverts commit 3b22f60. * fix issues * fix issues * remove extra space * fix: draggable resizing col jumps to right (#1421) * fix: draggable resizing col jumps to right * refactor: use ref instead of findDOMNode * fix: accidentally removed cel * Release 5.0.5 (#1424) * update changelog * Version bump to 5.0.5 [ci skip] * revert auto file changes * address aman comments
* Cell Tooltip - Focus Issues (adazzle#1422) * change level tooltip gets rendered and level it gets triggered * remove unsed editors and fix imports. * re order inclusion of frozen cells to avoid z-index css. * address comments * Revert "remove unsed editors and fix imports." This reverts commit 3b22f60. * fix issues * fix issues * remove extra space * fix: draggable resizing col jumps to right (adazzle#1421) * fix: draggable resizing col jumps to right * refactor: use ref instead of findDOMNode * fix: accidentally removed cel * Release 5.0.5 (adazzle#1424) * update changelog * Version bump to 5.0.5 [ci skip] * revert auto file changes * address aman comments
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. |
Description
A few sentences describing the overall goals of the pull request's commits.
fix: draggable + resizable column issue for resizing
If a column is both draggable and resizable, when resizing the right border of the current column jumps to the right.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behavior? (You can also link to an open issue here)
What is the new behavior?
Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information:
before fix:
after fix: