-
Notifications
You must be signed in to change notification settings - Fork 273
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(grid): [grid] fix the initial position on the left when dragging … #2719
Conversation
…the header to set width
WalkthroughThe pull request introduces modifications to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (6)packages/vue/src/grid/src/header/src/header.ts (6)
It appears that the
If
Using optional chaining prevents errors if
By subtracting
The calculation
Retrieving Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
概述此PR修复了在拖动表头以设置宽度时,初始位置偏左的问题。修复前,鼠标按下时初始位置比原位置偏左,导致列宽比预期小。修复后,初始位置与原位置一致。 变更
|
@@ -533,7 +534,7 @@ export default defineComponent({ | |||
|
|||
let ret = computeDragLeft(args) | |||
dragMinLeft = ret.dragMinLeft |
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.
The adjustment of dragLeft
calculation by removing dragBtnOffsetWidth
seems correct as it aligns the drag start position accurately with the button's position. Ensure that this change does not affect other dependent calculations.
OverviewThis PR fixes the issue where the initial position is to the left when dragging the table header to set the width. Before the fix, the initial position when the mouse was pressed was further to the left than the original position, causing the column width to be smaller than expected. After repair, the initial position is consistent with the original position. Change
|
…the header to set width
PR
修复当拖拽表头设置宽度时,初始位置偏左问题
修复前:
鼠标按下时,初始位置就比原位置偏左,导致鼠标松开后,列宽比原宽度小一些。
修复后:
初始位置与原位置一致
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
close #2631
Summary by CodeRabbit
The changes focus on refining the user interaction when resizing grid columns, ensuring a more precise and responsive dragging experience.