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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 BUG: flex prop fails to interpret numeric arguments presented as strings properly as numbers - a single entry in columnData as a string causes the entire flex to fail. #414

Open
LeadDreamer opened this issue Mar 16, 2024 · 0 comments

Comments

@LeadDreamer
Copy link

馃悰 Bug:

  • enterprise edition
  • @inovua/reactdatagrid-enterprise - version 5.10.2

What you did:
I use a form-driven system to format table columns - so that the data source defines it's column needs. I add the ability (in the string used to define the table formatting) to add extra props to the columnData - such as textarea:{flex=6}, where "textarea" defines an area to display a long string (preferably with wrap), and the "{}" wrapped string interpreted as a "&" seprated set of props and values.

What happened:
In other systems (of my own) where I have used this pattern, CSS interprets as a number any string that can be treated as a number.
In reactdatagrid, the value must be presented as a number. This makes it difficult to generalize by prop-insertion-options for reactdatagrid.

image if flex="6" is used:
image

image if flex=6 is used:
image

Reproduction repository:
https://github.com/SaltSweetSpirits/reactdatagrid_bug_example

Reproduction CodeSandBox:
https://codesandbox.io/p/github/SaltSweetSpirits/reactdatagrid_bug_example/main

You can use reactdevtools in the browser to change the flex settings on the column data.

Problem description:
CSS interprets flex setting strings as numbers if possible.
reactdatagrid "simulates" flex, but does not interpret flex setting strings as numbers.

This behavior is inconsistent and will lead to strange bugs.

Suggested solution:
Follow the CSS flex standard and interpret flex setting strings as numbers.

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