From 0b2df9fa4a742b507c9fb01e8b396f5184754ca4 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Wed, 8 Jan 2020 15:19:41 -0500 Subject: [PATCH] Block Library: Column: Add step attribute to column width range input Without this attribute value, if a user would enter a decimal value in the input range, the result of Element#checkValidity (in RangeControl) would be `false`, thus making it difficult/impossible to enter non-whole-number widths (e.g. `33.3`). There's a balance here between the effects of step, where ArrowUp/ArrowDown will now increment/decrement in smaller intervals than previously. This becomes further problematic if we want to support smaller decimal values (e.g. 33.33). A potential alternative would be to change the validation behavior of RangeControl to use a custom validation procedure in place of `Element#checkValidity`. --- packages/block-library/src/column/edit.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/block-library/src/column/edit.js b/packages/block-library/src/column/edit.js index a1775e88b350e4..bdd61a94d63199 100644 --- a/packages/block-library/src/column/edit.js +++ b/packages/block-library/src/column/edit.js @@ -52,6 +52,7 @@ function ColumnEdit( { } } min={ 0 } max={ 100 } + step={ 0.1 } required allowReset />