
Product
Reachability for Ruby Now in Beta
Reachability analysis for Ruby is now in beta, helping teams identify which vulnerabilities are truly exploitable in their applications.
@rhc-shared-components/scroll-to-error
Advanced tools
This scroll-to-error component can be used to scroll the page towards the first error of the form.
npm install --save @rhc-shared-components/scroll-to-error
## Usage
```tsx
import React from 'react';
import { Form, Formik } from 'formik';
import * as Yup from 'yup';
import { Title } from "@patternfly/react-core";
import { FormTextInput } from "@rhc-shared-components/form-text-input";
import { ScrollToError } from '@rhc-shared-components/scroll-to-error';
enum ExampleEnum{
FieldName ='companyLogo'
}
export const VALIDATIONSCHEMA = () => {
return Yup.object().shape({
[ExampleEnum.FieldName]:
Yup.string().required("required")
})
}
const App = () => {
return (
<div>
<Title headingLevel={'h1'}>Text Input with formik</Title>
<Formik
initialValues={{
[ExampleEnum.FieldName]: 'this is a test text'
}}
validationSchema={VALIDATIONSCHEMA}
enableReinitialize={true}
onSubmit={() => {
}}>
<Form>
<FormTextInput
name={ExampleEnum.FieldName}
label={'helloWorld label'}
helperText={'helloWorld helper'}
isRequired={true}
/>
<FormTextInput
name={ExampleEnum.FieldName}
label={'helloWorld label'}
helperText={'helloWorld helper'}
isRequired={true}
/>
<FormTextInput
name={"FieldName2"}
label={'helloWorld label'}
helperText={'helloWorld helper'}
isRequired={true}
/>
<FormTextInput
name={"FieldName3"}
label={'helloWorld label'}
helperText={'helloWorld helper'}
isRequired={true}
/>
<FormTextInput
name={"FieldName4"}
label={'helloWorld label'}
helperText={'helloWorld helper'}
isRequired={true}
/>
<FormTextInput
name={"FieldName5"}
label={'helloWorld label'}
helperText={'helloWorld helper'}
isRequired={true}
/>
<FormTextInput
name={"FieldName6"}
label={'helloWorld label'}
helperText={'helloWorld helper'}
isRequired={true}
/>
<FormTextInput
name={"FieldName7"}
label={'helloWorld label'}
helperText={'helloWorld helper'}
isRequired={true}
/>
<ScrollToError/>
<button type="submit">Submit</button>
</Form>
</Formik>
</div> );
}
export default App;
MIT © authorGithubUsername
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Reachability analysis for Ruby is now in beta, helping teams identify which vulnerabilities are truly exploitable in their applications.

Research
/Security News
Malicious npm packages use Adspect cloaking and fake CAPTCHAs to fingerprint visitors and redirect victims to crypto-themed scam sites.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.