Skip to content

Commit

Permalink
Block Library: Column: Add step attribute to column width range input
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
aduth committed Jan 8, 2020
1 parent 0048740 commit 0b2df9f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/block-library/src/column/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function ColumnEdit( {
} }
min={ 0 }
max={ 100 }
step={ 0.1 }
required
allowReset
/>
Expand Down

0 comments on commit 0b2df9f

Please sign in to comment.