Skip to content

Commit

Permalink
fixed issue WordPress#14166
Browse files Browse the repository at this point in the history
  • Loading branch information
Rebecca Jiang committed Apr 30, 2019
1 parent 9132183 commit 39ac780
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/block-library/src/rss/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ class RSSEdit extends Component {
onChange={ ( value ) => setAttributes( { itemsToShow: value } ) }
min={ DEFAULT_MIN_ITEMS }
max={ DEFAULT_MAX_ITEMS }
allowReset={ true }
initialValue={ 5 }
required
/>
<ToggleControl
Expand Down
4 changes: 3 additions & 1 deletion packages/components/src/range-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ function RangeControl( {
min,
max,
setState,
initialValue,
...props
} ) {
const id = `inspector-range-control-${ instanceId }`;
const currentInputValue = currentInput === null ? value : currentInput;
const initialInputValue = ! initialValue ? -1 : initialValue;
const resetValue = () => {
resetCurrentInput();
onChange();
onChange( parseFloat( initialInputValue ) );
};
const resetCurrentInput = () => {
if ( currentInput !== null ) {
Expand Down

0 comments on commit 39ac780

Please sign in to comment.