From 177bb0c9214ab64167a6b51e36b232d748c69bb6 Mon Sep 17 00:00:00 2001 From: ggregoire Date: Tue, 2 Oct 2018 12:57:29 -0500 Subject: [PATCH 1/3] Bump Ladda to v2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a391716..d56c7f2 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ }, "homepage": "https://github.com/jsdir/react-ladda#readme", "dependencies": { - "ladda": "^1.0.0", + "ladda": "^2.0.0", "prop-types": "^15.5.8" }, "devDependencies": { From 93e39a1ac2c4e915e692e1faa6920a18d61e720f Mon Sep 17 00:00:00 2001 From: ggregoire Date: Tue, 2 Oct 2018 13:09:01 -0500 Subject: [PATCH 2/3] Fix issue with Ladda import --- src/LaddaButton.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LaddaButton.jsx b/src/LaddaButton.jsx index c967da9..8e3abb8 100644 --- a/src/LaddaButton.jsx +++ b/src/LaddaButton.jsx @@ -1,6 +1,6 @@ import React, { Component } from 'react' import PropTypes from 'prop-types' -import Ladda from 'ladda' +import { create } from 'ladda' import { SIZES, STYLES } from './constants' @@ -48,7 +48,7 @@ class LaddaButton extends Component { }; componentDidMount() { - this.laddaInstance = Ladda.create(this.node) + this.laddaInstance = create(this.node) if (this.props.loading) { this.laddaInstance.start() From efb59b663de5c5fe03fdd23bce051971d4a8a710 Mon Sep 17 00:00:00 2001 From: ggregoire Date: Thu, 11 Oct 2018 16:49:52 -0500 Subject: [PATCH 3/3] .disable() has been removed in Ladda v2 --- src/LaddaButton.jsx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/LaddaButton.jsx b/src/LaddaButton.jsx index 8e3abb8..f303cbc 100644 --- a/src/LaddaButton.jsx +++ b/src/LaddaButton.jsx @@ -75,11 +75,6 @@ class LaddaButton extends Component { if (props.loading !== this.props.loading) { if (props.loading) { this.laddaInstance.start() - } else if (props.disabled) { - // .stop removes the attribute "disabled" - // .disable calls .stop then adds the attribute "disabled" - // see https://github.com/hakimel/Ladda/blob/master/js/ladda.js - this.laddaInstance.disable() } else { this.laddaInstance.stop() }