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

Formik modal #2034

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Formik modal #2034

wants to merge 5 commits into from

Conversation

moshloop
Copy link
Member

Goals:

  • set size, open, title, help, show*, on*, initialValues from inside the modal children
  • get the modal inner body height for sizing of code editors i.e. insde the child, get height of other form fields with a ref on their wrapping div, then set height on code editor to fill reminainig
  • buttons should always be pinned to footer, and have consistent styling

Copy link

vercel bot commented Jun 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
aws-preview ❌ Failed (Inspect) Jul 10, 2024 6:50am
flanksource-ui ✅ Ready (Inspect) Visit Preview Jul 10, 2024 6:50am

Copy link

netlify bot commented Jun 18, 2024

Deploy Preview for clerk-saas-ui ready!

Name Link
🔨 Latest commit 127dba3
🔍 Latest deploy log https://app.netlify.com/sites/clerk-saas-ui/deploys/668e2d0658e9790008a64f8f
😎 Deploy Preview https://deploy-preview-2034--clerk-saas-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jun 18, 2024

Deploy Preview for goofy-euclid-75956c ready!

Name Link
🔨 Latest commit 127dba3
🔍 Latest deploy log https://app.netlify.com/sites/goofy-euclid-75956c/deploys/668e2d067c9fa600089f2086
😎 Deploy Preview https://deploy-preview-2034--goofy-euclid-75956c.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jun 18, 2024

Deploy Preview for flanksource-demo-stable ready!

Name Link
🔨 Latest commit 127dba3
🔍 Latest deploy log https://app.netlify.com/sites/flanksource-demo-stable/deploys/668e2d06b9fc880008b8389b
😎 Deploy Preview https://deploy-preview-2034--flanksource-demo-stable.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mainawycliffe
Copy link
Contributor

@moshloop initialValues can only be set once in formik, before initialization, not after, when the form is loaded, you would need to update values, which you can do with the FormikContext, which you can setFieldValues, with the fields you need to update. I think we need to try and not deviate from this standard usage, which is already established, as long as the child component is inside a Formik form, it has access to the FormikContext and can be used to manipulate form values.

onSuccess: () => void;
selectedOption: CreateIntegrationOption;
selectedOption: IntegrationOption;
onBack: () => void;
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably need to remove this onBack duplicate

import HelpLink from "../Buttons/HelpLink";

interface FormikModalProps extends IModalProps {
initialValues?: Record<string, any>;
Copy link
Contributor

Choose a reason for hiding this comment

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

This in context will be ineffective, as initial value an only be set on initial render, and the children will have access to all formik controls, to update the values, so they can update the values directly instead, if they need to.

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.

2 participants