-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RNMobile] update mobile to not use ListEdit (#17070)
* [RNMobile] update mobile to not use ListEdit This update is in response to changes made on the web side in #15113 that were causing a crash on mobile. * Extract list block logic not shared with mobile to separate component * Improve name of AdditionalSettings component
- Loading branch information
Showing
4 changed files
with
56 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __ } from '@wordpress/i18n'; | ||
import { InspectorControls } from '@wordpress/block-editor'; | ||
import { | ||
TextControl, | ||
PanelBody, | ||
ToggleControl, | ||
} from '@wordpress/components'; | ||
|
||
const OrderedListSettings = ( { setAttributes, reversed, start } ) => ( | ||
<InspectorControls> | ||
<PanelBody title={ __( 'Ordered List Settings' ) }> | ||
<TextControl | ||
label={ __( 'Start Value' ) } | ||
type="number" | ||
onChange={ ( value ) => { | ||
const int = parseInt( value, 10 ); | ||
|
||
setAttributes( { | ||
// It should be possible to unset the value, | ||
// e.g. with an empty string. | ||
start: isNaN( int ) ? undefined : int, | ||
} ); | ||
} } | ||
value={ Number.isInteger( start ) ? start.toString( 10 ) : '' } | ||
step="1" | ||
/> | ||
<ToggleControl | ||
label={ __( 'Reverse List Numbering' ) } | ||
checked={ reversed || false } | ||
onChange={ ( value ) => { | ||
setAttributes( { | ||
// Unset the attribute if not reversed. | ||
reversed: value || undefined, | ||
} ); | ||
} } | ||
/> | ||
</PanelBody> | ||
</InspectorControls> ); | ||
|
||
export default OrderedListSettings; |
3 changes: 3 additions & 0 deletions
3
packages/block-library/src/list/ordered-list-settings.native.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Mobile has no additional list settings at this time, so render nothing | ||
const AdditionalSettings = () => null; | ||
export default AdditionalSettings; |