Skip to content

fix: preserve custom layout falsy values#5196

Merged
fangsmile merged 1 commit into
VisActor:developfrom
biubiukam:fix/issue-1949-custom-layout-value
Jun 25, 2026
Merged

fix: preserve custom layout falsy values#5196
fangsmile merged 1 commit into
VisActor:developfrom
biubiukam:fix/issue-1949-custom-layout-value

Conversation

@biubiukam

Copy link
Copy Markdown
Contributor

This is a ...

  • New feature
  • Bug fix
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Refactoring
  • Update dependency
  • Code style optimization
  • Test Case
  • Branch merge
  • Site / documentation update
  • Demo update
  • Workflow
  • Chore
  • Release
  • Other (about what?)

Related issue link

close #1949

Background and solution

Custom layout and custom render callbacks used table.getCellValue(...) || '' for the callback value. That converted valid falsy cell values such as 0 and false into an empty string, so custom layout logic could not distinguish those values from an empty cell.

This change passes table.getCellValue(...) through directly for custom layout and custom render callback args, the custom width/height measurement paths, and React custom layout updates.

Changelog

Language Changelog
English Preserve falsy cell values for custom layout and custom render callbacks.
Chinese 自定义布局和自定义渲染回调中保留单元格的假值。

Self-Check before Merge

Please check all items below before requesting a reviewing.

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Summary

  • Preserve 0 and false cell values in custom layout and custom render callback args.
  • Apply the same value passthrough during custom width/height computation and React custom layout updates.
  • Add a regression test for custom layout callback args.

Walkthrough

  • Added a custom layout test covering 0 and false callback values.
  • Removed the empty-string fallback from custom layout and custom render value plumbing.

Validation

  • node ../../common/scripts/install-run-rushx.js test -- columns/listTable-custom-layout.test.ts --runInBand
  • node common/scripts/install-run-rush.js build -t @visactor/react-vtable
  • node common/scripts/install-run-rush.js build -t @visactor/vtable-sheet
  • git push -u origin fix/issue-1949-custom-layout-value

@biubiukam
biubiukam marked this pull request as ready for review June 24, 2026 08:23
@fangsmile
fangsmile merged commit 02d1a6f into VisActor:develop Jun 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 自定义布局方法value不应处理默认值

2 participants