Tags: react-component/table
Tags
feat: scrollTo add align support (#1469) * feat: scrollTo add align * Update README.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update src/Table.tsx Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update src/interface.ts Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * fix: virtual table scrollTo align support - Add VirtualScrollConfig type with Exclude<ScrollLogicalPosition, 'center'> - Implement align mapping for virtual table (start->top, end->bottom, nearest->auto) - Add default align 'auto' when neither align nor offset provided - Add backward compatibility: default to 'top' when offset provided but align not - Update tests to cover align parameter scenarios - Fix offset JSDoc comment Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: implement real nearest behavior with offset in Table scrollTo - Fix nearest align to compute position after offset, then determine if scrolling is needed - Add align test buttons to scrollY and virtual demo files - Update center calculation formula Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: improve virtual table align handling Use nullish coalescing for safer align fallback Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test: add test for nearest align with element above viewport Adds test coverage for the scrollTo nearest alignment when the target element is above the current viewport after applying offset. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: unify align handling with switch statement Move nearest logic into switch for consistent code style. Also extract static ALIGN_MAP constant in BodyGrid.tsx. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: refine scrollIntoView with offset handling - Simplify scrollY demo buttons - Update README to note virtual table doesn't support center align - Refactor offset logic: call scrollIntoView first, then apply offset via scrollTo 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: simplify offset handling - scrollIntoView first then add offset 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: 刘欢 <lh01217311@antgroup.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
PreviousNext