Coder Social home page Coder Social logo

field-kit's Introduction

FieldKit

build status npm version license

FieldKit lets you take control of your text fields.

FieldKit provides real-time, text field formatting as users type. It simplifies input formatting and creates a more polished experience for users, while outputting standardized data.

Demo

See examples of built-in formatters and fields at the demo page.

Documentation

Please see our documentation for a more in depth overview.

Contributing

We’re glad you’re interested in FieldKit, and we’d love to see where you take it.

Please review CONTRIBUTING.md

field-kit's People

Contributors

alexgorbatchev avatar chocoboba avatar eventualbuddha avatar iamjoetaylor avatar jjowdy avatar jnovatnack avatar kamalsquare avatar karalel avatar keithchu avatar rpeng avatar square-build-bot avatar tamird avatar trmw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

field-kit's Issues

PhoneFormatter steals focus when the page is loaded

Steps to reproduce:

  1. Go to the demo page
  2. Do not click any mouse button. Wait until the page is fully loaded, then hit keyboard key 1.

What is expected:

3 As the focus is not on any input control, the page should not change.

What happened actually:

3 The page suddenly scrolls from top to PhoneFormatter field, and "1" is input to the field.

It happens in Chrome 49.0.2623.87 m and IE 11, but not in FireFox 42.0.

None works in Chrome on Android

Phone number
Input 4151234567
Output (451) 345-672

Credit Card
Input 3725123456
Output 5123 4563 72

Number
Doesn't do anything

Newest Chrome on Android

Alternative Input Methods

(e.g. browser autofill, scan credit card, 1Password, etc.) fail to validate, even in desktop browsers. When this happens, the fields remain invalid even if the user manually edits the input text.

Phone number not formatted correctly when deleting

fill in 1 (888) 888 8888

bug 1:
move cursor to right behind 1
press delete, it become (188) 888 8888

bug 2
move cursor to right before 8
press delete, it become 8 (888) 888 888

I think this problem happened during format switching, some weird stuff is happening with cursor position and delimiters.

Enable password-like protection on sensitive fields like SSN

By default, browsers treat a password input with obfuscation in the form of character masking with circles. Likewise, sometimes users would enjoy similar protection on fields containing sensitive information like social security numbers. It'd be neat if Field Kit solutioned for this in a similar manner, with some kind of show/hide functionality in SSN fields.

Add animated GIFs to wiki

  • Delimited Text Formatter
  • Credit Card Formatters
  • Expiry Date Formatter
  • Number Formatter
  • Phone Formatter
  • Social Security Number Formatter

PROTIP: if you add the image here in the comment, you can grab the URL and use it in the wiki.

Firefox issue - event not defined

When using this code:

field.setFormatter({
  format: function(value){
    var val = $val;
    if ( event.charCode >= 48 && event.charCode <= 57) {
        val = value;
    }

I get an JS error in Firefox that event is not defined. How can I define this by default?

backspace is not firing onchange event

I am using var ssnFormatter = new FieldKit.SocialSecurityNumberFormatter(); in my project with react.

However backspace is not firing onchange event.

compatibility with react

Hi guys,
great job with the library!

I was wondering if you are aware of any reason why this library wouldn't work 100% with react?
I succeeded using new FieldKit.CardTextField, but for some reason I am not having any luck with new FieldKit.CardTextField and new FieldKit.NumberFormatter, the field value simply doesn't reformat.

I can see people are posting code snippet specific for react interoperability
https://gist.github.com/pascallouisperez/605295fcf21db6175c12

which makes me think for some reason it could not work how of the box.

in case you confirm there are no issues I will extract a code snippet to complete the issue

Copy + paste for phone number fields doesn't work reliably

field-kit version
2.1.0

Copying and pasting phone numbers results in inconsistent formatting. The gif below demonstrates odd/inconsisten results in different situations.

Expected behavior is the following:

  1. Highlight text to be replaced, then paste full number (541) 754-3010.
  2. The field contains a properly formatted phone number including all of the digits.

field-kit-phone-number-bug

Currency formats

Currency doesn't seem to handle thousands or going out beyond 2 decimal places.

1200 is displayed as 1200 instead of 1,200

1.23434234 is displayed as 1.23434234

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.