forked from mengyxu/noob-components
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.6 KiB
1.6 KiB
list-table-v2 Hidden Mini Table for Row Height
Goal
Replace the current probe row approach with a hidden mini table that uses flex boxes (not el-table-v2) to measure row height without causing visual flickering during resize/scroll.
Requirements
- Render a hidden container with 3-5 sample rows using pure flex boxes
- Width must respond to viewport changes (use container queries or width percentage)
- Row height from mini table used as
estimatedRowHeightfor el-table-v2 - No window resize event listeners - use container-based sizing
- No visual flickering during resize or scroll
Approach
Instead of using a single hidden probe row that gets measured repeatedly on resize:
- Create a mini hidden div that mimics the table's cell layout
- The mini table's width is tied to its container (no explicit resize listener needed)
- CSS-based layout that automatically reflows with container width
- Use ResizeObserver ONLY on the mini table container (not window)
Technical Notes
- Use
display: flex; flex-direction: column;for row structure - Each "row" is a flex container with same padding/styling as actual table cells
- Use
container-type: inline-sizeCSS for container queries (or simple width: 100%) - ResizeObserver on the mini table wrapper to detect width changes
- Only re-measure when width actually changes (debounced)
Acceptance Criteria
- No flickering when resizing window
- No flickering when scrolling
- Row height updates correctly when container width changes (column flex distribution changes)
- Hidden mini table doesn't affect layout or cause scrollbar issues
- Build passes without errors