Skip to content
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

Incorrect Typing for Margins in the TableConfig Interface Definition #3815

Open
Maito1794 opened this issue Jan 23, 2025 · 0 comments
Open

Comments

@Maito1794
Copy link

I came across an error in the typing of the margins property in the TableConfig interface definition.

In the table function, the config parameter can include a margins object, which is expected to have four properties: left, top, bottom, and width. You can see this implementation in this reference.

However, if you look at the typings, the Table definition expects a TableConfig object (see Table definition). In this TableConfig, the margins property is incorrectly defined as a number instead of an object with the shape { top: number, bottom: number, left: number, width: number }.

This discrepancy leads to issues when you pass a TableConfig like this:
tableConfig:{ margins: 10 }
In this case, when the table reaches the end of the page, it won’t create a new page as expected.

It’s important to note that if no margins are provided in the tableConfig, the program uses default margins (See here). However, if a number is passed (as allowed by the current typings), the program detects that a value is present and does not apply the default margins, leading to unexpected behavior.

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

No branches or pull requests

1 participant