Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 29, 2025

  • Analyze the TagInput scroll issue in horizontal scroll display mode
  • Identify the root cause: the scroll element was incorrectly set to .t-input instead of .t-input__prefix
  • Fix updateScrollElement to query the correct .t-input__prefix element which has the scrollable styles
  • Fix scrollToRight to refresh the scroll element reference before scrolling
  • Fix onWheel to handle both deltaX and deltaY for Mac trackpad and Windows mouse wheel
  • Fix lint error: remove trailing whitespace on line 43
  • Run security scan - no vulnerabilities found
Original prompt

This section details on the original issue you should resolve

<issue_title>[TagInput] 在横向滚动显示的方式下,滚动条的位置不正确</issue_title>
<issue_description>### tdesign-vue-next 版本

最新版

重现链接

https://stackblitz.com/run?file=package.json,src%2Fdemo.vue

重现步骤

横向滚动方式下,在不断输入并回车的情况下,滚动条应该自动滚动到最后。

Image

期望结果

滚动条自动滚动到末尾

实际结果

滚动条位置不正确

框架版本

vue 3.5.18

浏览器版本

Chrome 139.0.7258.138

系统版本

Macos 15.6 (24G84)

Node版本

22.17.1

补充说明

另外,在聚焦的情况下,滚动鼠标滑轮,期望能直接左移或右移滚动条。</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix incorrect scrollbar position in TagInput component fix(tag-input): fix scroll position in horizontal scroll mode Nov 29, 2025
Copilot AI requested a review from liweijie0812 November 29, 2025 08:19
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 29, 2025

tdesign-vue-next-demo

npm i https://pkg.pr.new/Tencent/tdesign-vue-next/@tdesign-vue-next/auto-import-resolver@6213
npm i https://pkg.pr.new/Tencent/tdesign-vue-next@6213
npm i https://pkg.pr.new/Tencent/tdesign-vue-next/@tdesign-vue-next/chat@6213

commit: a9bdfb4

@tdesign-bot
Copy link
Collaborator

tdesign-bot commented Nov 29, 2025

TDesign Component Site Preview Open

Component Preview
tdesign-vue-next 完成
@tdesign-vue-next/chat 完成

@liweijie0812
Copy link
Collaborator

@copilot 新增标签后,滚动条不会自动滚动

Copy link
Contributor Author

Copilot AI commented Nov 29, 2025

@copilot 新增标签后,滚动条不会自动滚动

Fixed in cd463b2. Changed to use double requestAnimationFrame to ensure the DOM layout is fully updated before calculating the scroll distance. The first rAF waits for style calculation, and the second rAF waits for layout completion.

@liweijie0812
Copy link
Collaborator

@copilot 添加新标签后滚动条不会自动滚动到末尾,该问题未修复

Copy link
Contributor Author

Copilot AI commented Nov 29, 2025

@copilot 添加新标签后滚动条不会自动滚动到末尾,该问题未修复

Fixed in 29b97dc. The root cause was that the scroll was being applied to the wrong element (.t-input instead of .t-input__prefix). The .t-input__prefix element is the actual scrollable container where the tags are rendered. Now the code correctly queries for .t-input__prefix using querySelector and refreshes the element reference before scrolling.

@liweijie0812
Copy link
Collaborator

@copilot
Check failure on line 43 in packages/components/tag-input/hooks/useTagScroll.ts

GitHub Actions
/ lint

Delete ····

Copy link
Contributor Author

Copilot AI commented Nov 29, 2025

@copilot
Check failure on line 43 in packages/components/tag-input/hooks/useTagScroll.ts

...

Fixed in a9bdfb4. Removed the trailing whitespace on line 43.

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

Successfully merging this pull request may close these issues.

[TagInput] 在横向滚动显示的方式下,滚动条的位置不正确

3 participants