Git Product home page Git Product logo

finput's People

Contributors

alisd23 avatar chrisprice avatar ggovan avatar moxon6 avatar msuperina avatar oriondean avatar rcassonscottlogic avatar ryanggrey avatar stevenjob avatar

Stargazers

 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

finput's Issues

Pressing a shortcut key on an selection should not add to existing value

If I select 6,000,000 and hit the letter K, I expect the value to be 1,000 rather than 6,000,000,000.
When you have an entire selection, the native behaviour is to replace that selection with whatever value is entered.

Reproduction Steps:

  1. Enter 6m into input
  2. select all the text in the input
  3. hit the letter 'k'
  4. notice that the shortcut adds to the current number.

Input inserted despite shift-key held down

When I attempt to insert a pound symbol (shift key + number 3) the number 3 is inserted into the input field.

Instead, nothing should be entered into the input field as the £ key is invalid.

This is also the case for other shift-key related special characters

Migrate to using only npm dev scripts

At the moment we use a combination of grunt and npm scripts. Might be nicer to have a consistent approach so we only need to use one command line tool when developing testing (see running tests).

Create website

  • Example
  • Description
  • Quick Start (Usage?)
  • Documentation
  • Testing (and browser stack logo)

Compatibility with type=number

Would give more appropriate on-screen keyboard, if the component user specified that on the input. Or use the step attribute for the up/down arrow native behaviour.

However, that type doesn't support selections so at the moment it gives an error.

Caret position incorrect after adding digit

When entering digits into particular numbers, the caret position is shifted to an incorrect location.

Example

  1. Enter 123456 into input
  2. move caret to 123|,456
  3. Enter number
  4. Notice that the caret is now behind that number

Note: | symbolises caret position

Keyboard copy+paste broken on macOS

I think this is because we manually check to see if ctrl key is pressed before preventing defaults.

When fixing this we should look at the 10 tests that fail on macOS. They all specify the use of the ctrl key. I guess we either need to select modifier key based on the OS or come up with a more generic way to do this (use right click menu?).

Clipboard Support

The amount control should support cut/copy/paste actions by the user.

Requirements:

  • Pasting invalid input into the control should not be allowed (e.g. sdfsfa)
  • Pasting valid input into the control should reformat the number
  • Pasting shortcuts into the control should be supported (e.g. 1m, 1k)
  • Cutting from the amount control should reformat the number

Allow for manual setting of options

It would be nice if there was a manual function call to allow for setting of options at a later date, without having to tear down and recreating a finput. This would be useful if, for example, you are displaying an amount in relation to a currency pair (so the number of decimals is pertinent). If the user then changes a currency pair, this could result in the number of decimals needing to be changed.

A simple setOptions would suffice :)

Auto-formatting applied too soon in IE11

I want to enter 12
I press 1
The input formats immediately, resulting in "1.00" with the cursor at the end

In Chrome/FF, formatting only happens when I leave the field.

Add invalid input attempted API endpoint

Some clients wish to observe when the user attempts to add an invalid character into finput.
An API endpoint should be exposed to allow clients to easily listen in on when such an event occurs.
They should have the flexibility to handle this event however they wish (e.g. shake animation).

Remove numeral

Just follow the formatting conventions defined by the API.

Drag 'n Drop Support

The amount control should allow the user to drag and drop values into/out of the input field.

Requirements
  • Any invalid input dragged into the input field should be ignored
  • Dragging a selection out of the input field should reformat the number (This is automatically done on 'focus out')
  • Selecting a selection, and dragging it around inside the input field should reformat the number
  • Handle dragging in shortcuts - expand [k, m, b] to [1000, etc...]

Simplify API

Restrictions

  • scale attempts to modify value to have more decimals digits than this are ignored default 2
  • range -
    • all no restriction default
    • positive attempts to enter a negative value are ignored

Formatting

  • fixed after focus is lost -
    • true value is formatted to scale number of decimals default
    • false to leave as entered
  • decimal the character used for the decimal point default .
  • thousands the separator used for thousands default ,

Other

  • shortcuts object of character to multiplier default { k: 1000, m: 1000000, b: 1000000000 }

Deletion Support

The amount control should support the usage of the following deletion methods:

Pressing the backspace key should remove the previous digit or skip over the previous delimiter

  • Skip over
  • Remove previous

Pressing the delete key should remove the digit ahead of it, or skip over the delimiter ahead

  • Skip over
  • Remove next

  • Ctrl+backspace/delete should behave the same as backspace/delete
  • Selecting various digits and pressing backspace/delete should only delete the selection

Add CI

Just to run the build

Up / Down arrow support

Pressing the up/down arrow on the keyboard should increment/decrement the amount in the field by one

Locale support

Different countries use different thousands and decimal delimiters.

Requirements
  • Allow a country to be passed in as a config option which as preset values (e.g. uk = comma and decimal, dk = decimal and comma)
  • Allow the thousands / decimal delimiters to be manually overidden via config options

Undo / Redo support

The amount control should support a user performing the undo/redo action

Requirements
  • Undo should restore the input fields value to its previous state (ctrl-z)
  • Redo should restore an undo (ctrl-y)

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.