Socket
Socket
Sign inDemoInstall

react-input-mask

Package Overview
Dependencies
3
Maintainers
1
Versions
90
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.5.9 to 0.5.10

2

build/InputElement.js

@@ -458,2 +458,3 @@ // https://github.com/sanniassin/react-input-mask

var caretPos = this.getCaretPos();
var selection = this.getSelection();
var value = this.state.value;

@@ -472,2 +473,3 @@ var mask = this.mask;

if (editablePos !== null && this.isAllowedChar(key, editablePos)) {
value = this.clearRange(value, selection.start, selection.length);
value = this.insertRawSubstr(value, key, editablePos);

@@ -474,0 +476,0 @@ caretPos = editablePos + 1;

@@ -454,2 +454,3 @@ // https://github.com/sanniassin/react-input-mask

var caretPos = this.getCaretPos();
var selection = this.getSelection();
var { value } = this.state;

@@ -467,2 +468,3 @@ var { mask, maskChar } = this;

if (editablePos !== null && this.isAllowedChar(key, editablePos)) {
value = this.clearRange(value, selection.start, selection.length);
value = this.insertRawSubstr(value, key, editablePos);

@@ -469,0 +471,0 @@ caretPos = editablePos + 1;

2

package.json
{
"name": "react-input-mask",
"description": "Masked input component for React",
"version": "0.5.9",
"version": "0.5.10",
"homepage": "https://github.com/sanniassin/react-input-mask",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -30,3 +30,3 @@ # react-input-mask

render: function() {
return <InputElement {...this.props} mask="+4\\9 99 999 99" maskChar=" "/>;
return <InputElement {...this.props} mask="+4\9 99 999 99" maskChar=" "/>;
}

@@ -33,0 +33,0 @@ });

@@ -236,5 +236,13 @@ import React from 'react';

TestUtils.Simulate.keyPress(inputNode, { key: '6' });
expect(inputNode.value).toEqual('+7 (611) 112 34 56');
input.setSelection(4, 3);
TestUtils.Simulate.keyPress(inputNode, { key: '0' });
expect(inputNode.value).toEqual('+7 (012) 345 6');
input.setCaretPos(14)
TestUtils.Simulate.keyPress(inputNode, { key: '7' });
TestUtils.Simulate.keyPress(inputNode, { key: '8' });
TestUtils.Simulate.keyPress(inputNode, { key: '9' });
TestUtils.Simulate.keyPress(inputNode, { key: '4' });
expect(inputNode.value).toEqual('+7 (012) 345 67 89');
inputNode.value = '+7 (';

@@ -241,0 +249,0 @@ input.setCaretPos(4);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc