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

Add toggle switches support #46

Merged
merged 4 commits into from
Dec 4, 2023
Merged

Add toggle switches support #46

merged 4 commits into from
Dec 4, 2023

Conversation

ischaojie
Copy link
Contributor

@ischaojie ischaojie commented Dec 2, 2023

fixes #32

image

Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks so much, looking good.

case 'FormFieldCheckbox':
switch (subElement) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather than copying logic, can we combine this with the logic below, maybe worth moving out into a separate function?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can probably use the {[string]: bool} variant of ClassName to make most of these cases more declarative.

python/fastui/components/forms.py Show resolved Hide resolved
packages/fastui/src/components/FormField.tsx Outdated Show resolved Hide resolved
@samuelcolvin samuelcolvin enabled auto-merge (squash) December 4, 2023 13:06
@samuelcolvin
Copy link
Member

This is great, thanks so much.

@samuelcolvin samuelcolvin mentioned this pull request Dec 4, 2023
@samuelcolvin samuelcolvin merged commit 8beb7fd into pydantic:main Dec 4, 2023
4 checks passed
@ischaojie ischaojie deleted the dev branch December 4, 2023 13:09
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

Successfully merging this pull request may close these issues.

Toggle switches
2 participants