font-picker-react
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -81,6 +81,6 @@ 'use strict'; | ||
} | ||
FontPicker.prototype.componentDidUpdate = function () { | ||
FontPicker.prototype.componentDidUpdate = function (prevProps) { | ||
var fontFamilyProps = this.props.activeFontFamily; | ||
var fontFamilyState = this.state.activeFontFamily; | ||
if (fontFamilyProps !== fontFamilyState) { | ||
if (fontFamilyProps !== prevProps.activeFontFamily && fontFamilyProps !== fontFamilyState) { | ||
this.setActiveFontFamily(fontFamilyProps); | ||
@@ -106,8 +106,6 @@ } | ||
FontPicker.prototype.setActiveFontFamily = function (activeFontFamily) { | ||
var onChange = this.props.onChange; | ||
this.fontManager.setActiveFont(activeFontFamily); | ||
var _this = this; | ||
this.setState({ | ||
activeFontFamily: activeFontFamily, | ||
}); | ||
onChange(this.fontManager.getActiveFont()); | ||
}, function () { return _this.fontManager.setActiveFont(activeFontFamily); }); | ||
}; | ||
@@ -114,0 +112,0 @@ FontPicker.prototype.generateFontList = function (fonts) { |
{ | ||
"name": "font-picker-react", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Font selector component for Google Fonts", | ||
@@ -40,3 +40,3 @@ "author": "Samuel Meuli <me@samuelmeuli.com>", | ||
"dependencies": { | ||
"font-picker": "^3.0.0" | ||
"font-picker": "^3.0.3" | ||
}, | ||
@@ -62,3 +62,3 @@ "peerDependencies": { | ||
"eslint-plugin-react": "^7.11.1", | ||
"husky": "^1.1.4", | ||
"husky": "^2.2.0", | ||
"lint-staged": "^8.1.5", | ||
@@ -70,4 +70,4 @@ "npm-run-all": "^4.1.3", | ||
"rollup": "^1.7.4", | ||
"rollup-plugin-typescript2": "^0.20.1", | ||
"stylelint": "^9.10.1", | ||
"rollup-plugin-typescript2": "^0.21.0", | ||
"stylelint": "^10.0.1", | ||
"typescript": "^3.3.4000" | ||
@@ -74,0 +74,0 @@ }, |
@@ -24,6 +24,6 @@ # Font Picker for React | ||
Install the `font-picker` package using NPM: | ||
Install the `font-picker-react` package using NPM: | ||
```sh | ||
npm install font-picker | ||
npm install font-picker-react | ||
``` | ||
@@ -87,3 +87,3 @@ | ||
_Currently, only the `activeFontFamily`, `onChange` and `sort` props are reactive._ | ||
_Currently, only the `activeFontFamily` and `sort` props are reactive._ | ||
@@ -90,0 +90,0 @@ ## Development |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
14981
0
156
Updatedfont-picker@^3.0.3