New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-pikaday

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-pikaday - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

2

example/app.js

@@ -59,3 +59,3 @@ /** @jsx React.DOM */

<p>
<Pikaday linkedValue={this.linkState('date')} />
<Pikaday valueLink={this.linkState('date')} />
</p>

@@ -62,0 +62,0 @@ <button onClick={() => { this.setState({date: null}); }}>

{
"name": "react-pikaday",
"version": "0.1.0",
"version": "0.2.0",
"description": "A React component wrapper around Pikaday.",
"main": "src/Pikaday.js",
"repository": {
"type": "git",
"url": "http://github.com/thomasboyt/react-pikaday.git"
},
"dependencies": {
"pikaday": "git://github.com/thomasboyt/pikaday#clear-field-on-falsy-setDate",
"pikaday": "^1.2.0",
"react": "^0.11.2"

@@ -25,3 +28,7 @@ },

},
"browserify": {
"transform": [
"reactify"
]
},
"scripts": {

@@ -28,0 +35,0 @@ "test": "scripts/test",

@@ -113,2 +113,35 @@ /** @jsx React.DOM */

});
describe('clearing the value', () => {
it('works with LinkedStateMixin', function () {
var Form = React.createClass({
mixins: [ React.addons.LinkedStateMixin ],
getInitialState: function() {
return { date: new Date(2014, 0, 1) };
},
render: function() {
return (
<div>
<Pikaday ref="pikaday" valueLink={this.linkState('date')} />
<button ref="clearBtn"
onClick={() => this.setState({ date: null })}>
Clear
</button>
</div>
);
}
});
var component = React.renderComponent(<Form />, document.createElement('div'));
var input = TU.findRenderedDOMComponentWithTag(component, 'input').getDOMNode();
expect(input.value).to.be.eql('2014-01-01');
var clearBtn = component.refs.clearBtn.getDOMNode();
TU.Simulate.click(clearBtn);
expect(input.value).to.be.eql('');
});
});
});

@@ -1,3 +0,1 @@

/** @jsx React.DOM */
var React = require('react');

@@ -30,2 +28,6 @@ var Pikaday = require('pikaday');

if ( newTime !== prevTime ) {
if ( newDate === null ) {
// Workaround for pikaday not clearing value when date set to falsey
this.refs.pikaday.getDOMNode().value = '';
}
this._picker.setDate(newDate, true); // 2nd param = don't call onSelect

@@ -32,0 +34,0 @@ }

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc