All Projects โ†’ final-form โ†’ Final Form Focus

final-form / Final Form Focus

Licence: mit
๐Ÿ Final Form "decorator" that will attempt to apply focus to the first field with an error upon an attempted form submission

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Final Form Focus

Pesdk Ios Examples
A fully customizable photo editor for your app.
Stars: โœญ 837 (+1078.87%)
Mutual labels:  blur, focus
X Postprocessing Library
Unity Post Processing Stack Library | Unityๅผ•ๆ“Ž็š„้ซ˜ๅ“่ดจๅŽๅค„็†ๅบ“
Stars: โœญ 1,079 (+1419.72%)
Mutual labels:  blur
Forceblur
ForceBlur Animation for iOS Messaging Apps
Stars: โœญ 666 (+838.03%)
Mutual labels:  blur
Blur desktop
็บฏhtmlๅฎž็Žฐ็ฑปไผผmac os ๅŠจๆ€้ซ˜ๆ–ฏๆจก็ณŠๆ•ˆๆžœ
Stars: โœญ 9 (-87.32%)
Mutual labels:  blur
Etsyblur
EtsyBlur is an Android library that allows developers to easily add a glass-like blur effect implemented in the Etsy app.
Stars: โœญ 739 (+940.85%)
Mutual labels:  blur
Translucenttb
A lightweight utility that makes the Windows taskbar translucent/transparent.
Stars: โœญ 8,816 (+12316.9%)
Mutual labels:  blur
Miblurpopup
MIBlurPopup lets you create popups with a blurred background
Stars: โœญ 598 (+742.25%)
Mutual labels:  blur
Blur
Extension to UIView to apply blur/vibrant effect. Written in Swift.
Stars: โœญ 63 (-11.27%)
Mutual labels:  blur
Ng Focus On
A directive to make angular elements focusable
Stars: โœญ 51 (-28.17%)
Mutual labels:  focus
Lmdropdownviewswift
LMDropdownViewSwift is a simple dropdown view inspired by Tappy.
Stars: โœญ 18 (-74.65%)
Mutual labels:  blur
React Focus Lock
It is a trap! A lock for a Focus. ๐Ÿ”“
Stars: โœญ 749 (+954.93%)
Mutual labels:  focus
Visualeffectview
Dynamic blur background view with tint color (UIVisualEffectView subclass) ๐Ÿ“ฑ
Stars: โœญ 795 (+1019.72%)
Mutual labels:  blur
Kirby Autofocus
Content aware image cropping for Kirby. Kirby 2 and 3.
Stars: โœญ 35 (-50.7%)
Mutual labels:  focus
Glasscord
[BUGFIXES ONLY, SUPPORT WILL DROP MAR 1, 2021] Injecting composition effects into Electron applications!
Stars: โœญ 737 (+938.03%)
Mutual labels:  blur
Blurry
๐ŸŒซ Image Blurring in Swift
Stars: โœญ 56 (-21.13%)
Mutual labels:  blur
Blurify
blurify.js is a tiny(~2kb) library to blurred pictures, support graceful downgrade from `css` mode to `canvas` mode.
Stars: โœญ 665 (+836.62%)
Mutual labels:  blur
Collectionviewpaginglayout
a simple but highly customizable paging layout for UICollectionView.
Stars: โœญ 947 (+1233.8%)
Mutual labels:  blur
Obs Streamfx
StreamFX is a plugin for OBS Studio which adds many new effects, filters, sources, transitions and encoders - all for free! Be it 3D Transform, Blur, complex Masking, or even custom shaders, you'll find it all here.
Stars: โœญ 1,128 (+1488.73%)
Mutual labels:  blur
Iconhandler
Tint you Icons, change the size, apply alpha color and set a position easily. ๐Ÿ‘“
Stars: โœญ 59 (-16.9%)
Mutual labels:  focus
Dali
Dali is an image blur library for Android. It contains several modules for static blurring, live blurring and animations.
Stars: โœญ 1,021 (+1338.03%)
Mutual labels:  blur

๐Ÿ Final Form Focus ๐Ÿง

NPM Version NPM Downloads Build Status codecov.io styled with prettier

Decorator for ๐Ÿ Final Form that will attempt to apply focus to the first field with an error upon an attempted form submission.


Demo


Installation

npm install --save final-form final-form-focus

or

yarn add final-form final-form-focus

Usage

๐Ÿ Final Form Usage

import { createForm } from 'final-form'
import createDecorator from 'final-form-focus'

// Create Form
const form = createForm({ onSubmit })

// Create Decorator
const decorator = createDecorator()

// Decorate form
const undecorate = decorator(form)

// Use form as normal

๐Ÿ React Final Form Usage

import React from 'react'
import { Form, Field } from 'react-final-form'
import createDecorator from 'final-form-focus'

const focusOnErrors = createDecorator()
...
<Form
  onSubmit={submit}
  decorators={[ focusOnErrors ]} // <--------- ๐Ÿ˜Ž
  validate={validate}
  render={({ handleSubmit }) =>
    <form onSubmit={handleSubmit}>

      ... inputs here ...

    </form>
  }
/>

Example

Focus On Error Example

Demonstrates how ๐Ÿ Final Form Focus ๐Ÿง works with ๐Ÿ React Final Form.

API

createDecorator: (getInputs?: GetInputs, findInput?: FindInput) => Decorator

A function that takes an optional function to collect a list of focusable inputs on the page and provides a ๐Ÿ Final Form Decorator that will focus on the top-most input on the page with an error when a form submission fails. If no getInputs parameter is provided, it will use a generic one that will return all inputs that appear in document.forms. If no findInput parameter is provided, it will use a generic one that matches the name attribute of the focusable input with the path in the error object.

getFormInputs: (formName: string) => GetInputs

A GetInputs generator that will narrow the list of inputs down to those contained in the named form, i.e. document.forms[formName].

Types

FocusableInput: { name: string, focus: () => void }

A light abstraction of any input that has a name property and upon which focus() may be called.

GetInputs: () => FocusableInput[]

A function that collects a list of focusable inputs that exist on the page.

FindInput: (FocusableInput[], {}) => ?FocusableInput

A function that returns the first element in a list of focusable inputs that has an error

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].