From b7c236376b94290bef88a6037ce11f2a69e20d26 Mon Sep 17 00:00:00 2001 From: Mahammed Zishan Khan <3067041+mahammedzkhan@users.noreply.github.com> Date: Tue, 1 Feb 2022 18:23:37 +0100 Subject: [PATCH] fix: cast string to Number when setting attribute (#21) Co-authored-by: zishan --- README.md | 4 ++++ scripts/block.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e82220..248ccab 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,10 @@ caching time of 12 hours obviously makes no sense. ## Changelog +### 1.2.1 - 2022-02-01 + +* Fix issue with limit in Gutenberg block. + ### 1.2.0 - 2022-01-23 * Requires WordPress 4.7 or above diff --git a/scripts/block.js b/scripts/block.js index 3c1ab22..01860c2 100644 --- a/scripts/block.js +++ b/scripts/block.js @@ -152,7 +152,7 @@ disabled: props.attributes.unlimited, value: props.attributes.limit, onChange: function( val ) { - props.setAttributes( { limit: val } ); + props.setAttributes( { limit: Number( val ) } ); }, } ),