mui / toolpad

Toolpad: Full stack components and low-code builder for dashboards and internal apps.
https://mui.com/toolpad/
MIT License
964 stars 243 forks source link

Throw an exception when creating a custom component with a hyphen #790

Closed oliviertassinari closed 2 years ago

oliviertassinari commented 2 years ago

Duplicates

Latest version

Current behavior 😯

It throws.

Expected behavior 🤔

It works.

Steps to reproduce 🕹

Steps:

  1. Open https://master--toolpad.mui.com/_toolpad/app/cl42qt2jx01249xnr14xjce8b/editor/pages/cl42qt2kt00029xnr5rta2nog
  2. Screenshot 2022-08-13 at 13 40 37
  3. Screenshot 2022-08-13 at 13 40 50

Context 🔦

It's never clear to me what capitalization and word separation I should use in the different text fields of Toolpad.

Your environment 🌎

No response

Janpot commented 2 years ago

We should add validation to this input, and the create button should be disabled as long as the input is invalid

oliviertassinari commented 2 years ago

the create button should be disabled

I would be in favor of never disabling a submit button, but to make it a noop and to show the error when pressed.

Janpot commented 2 years ago

I would be in favor of never disabling a submit button, but to make it a noop and to show the error when pressed.

I imagine we could decide on a case-by-case basis.