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

Remove - from select options #1630

Merged
merged 3 commits into from
Feb 3, 2023
Merged

Remove - from select options #1630

merged 3 commits into from
Feb 3, 2023

Conversation

Janpot
Copy link
Member

@Janpot Janpot commented Feb 3, 2023

deprecate argType.defaultValue and move it into the type definition as default, advantages:

  • we can now use it in the property control.
  • It's closer to its jsonschema counterpart
  • it makes more sense logically, especially when we will expand into typing nested objects, we will be able to reuse it for nested properties
  • deprecated as to not break existing custom components

This allows us to detect whether an enum type has a default value and therefore there shouldn't be a "empty" option in a select.

Fixes #1611

I'm leaving the id field selector of the datagrid as it is as it's a bit ore complex. The items are not predefined and an empty datagrid doesn't have any options to choose from anyway. Will look into this separately

@oliviertassinari oliviertassinari requested a deployment to select-default - toolpad-db PR #1630 February 3, 2023 09:58 — with Render Abandoned
@oliviertassinari oliviertassinari temporarily deployed to select-default - toolpad PR #1630 February 3, 2023 09:59 — with Render Destroyed
@Janpot Janpot added the feature: Components Button, input, table, etc. label Feb 3, 2023
@oliviertassinari oliviertassinari temporarily deployed to select-default - toolpad PR #1630 February 3, 2023 10:09 — with Render Destroyed
@oliviertassinari oliviertassinari temporarily deployed to select-default - toolpad PR #1630 February 3, 2023 10:12 — with Render Destroyed
@Janpot Janpot marked this pull request as ready for review February 3, 2023 10:34
@Janpot Janpot requested a review from a team February 3, 2023 12:11
@Janpot Janpot merged commit 3e4aeb5 into master Feb 3, 2023
@Janpot Janpot deleted the select-default branch February 3, 2023 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: Components Button, input, table, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove "-" from component props drop-down options when there is a default value
3 participants