File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ import defaultStyles from './defaultStyles';
1515import type { DraftJsTextPropsType } from './types' ;
1616
1717const DraftJsText = ( props : DraftJsTextPropsType ) : any => {
18- const { text } = props ;
18+ const { text, renderEmptyBlocks } = props ;
1919 let textElements = text ;
2020
21- if ( textElements ) {
21+ if ( textElements || renderEmptyBlocks ) {
2222 textElements = loadAttributes ( {
2323 text : props . text ,
2424 customStyles : props . customStyles ,
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export type BlockQuotePropsType = {
1515 entityRanges : Array < Object > ,
1616 entityMap : ?Object ,
1717 textProps : ?Object ,
18+ renderEmptyBlocks : boolean ,
1819} ;
1920
2021export type DraftJsTextPropsType = {
@@ -27,6 +28,7 @@ export type DraftJsTextPropsType = {
2728 entityMap : ?Object ,
2829 navigate ?: Function ,
2930 textProps : ?Object ,
31+ renderEmptyBlocks : boolean ,
3032} ;
3133
3234export type OrderedListItemPropsType = {
@@ -42,6 +44,7 @@ export type OrderedListItemPropsType = {
4244 depth : number ,
4345 defaultMarginLeft : number ,
4446 textProps : ?Object ,
47+ renderEmptyBlocks : boolean ,
4548} ;
4649
4750export type UnorderedListItemPropsType = {
@@ -55,6 +58,7 @@ export type UnorderedListItemPropsType = {
5558 depth : number ,
5659 defaultMarginLeft : number ,
5760 textProps : ?Object ,
61+ renderEmptyBlocks : boolean ,
5862} ;
5963
6064export type TextStyledPropsType = {
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ type ParamsType = {
2020 blocks : ?Array < * > ,
2121 entityMap : Object ,
2222 } ,
23+ renderEmptyBlocks : boolean ,
2324 customStyles : Object ,
2425 atomicHandler : Function ,
2526 navigate ?: Function ,
@@ -36,6 +37,7 @@ export const ViewAfterList = (props: Object): React$Element<*> => (
3637const getBlocks = ( params : ParamsType ) : ?Array < React$Element < * >> => {
3738 const {
3839 contentState,
40+ renderEmptyBlocks,
3941 customStyles,
4042 navigate,
4143 orderedListSeparator,
@@ -123,6 +125,7 @@ const getBlocks = (params: ParamsType): ?Array<React$Element<*>> => {
123125 { viewBefore }
124126 < DraftJsText
125127 { ...itemData }
128+ renderEmptyBlocks = { renderEmptyBlocks }
126129 entityMap = { contentState . entityMap }
127130 customStyles = { customStyles }
128131 navigate = { navigate }
@@ -160,6 +163,7 @@ const getBlocks = (params: ParamsType): ?Array<React$Element<*>> => {
160163 customStyles = { customStyles }
161164 navigate = { navigate }
162165 textProps = { textProps }
166+ renderEmptyBlocks = { renderEmptyBlocks }
163167 />
164168 </ View >
165169 ) ;
@@ -178,6 +182,7 @@ const getBlocks = (params: ParamsType): ?Array<React$Element<*>> => {
178182 navigate = { navigate }
179183 defaultMarginLeft = { depthMargin }
180184 textProps = { textProps }
185+ renderEmptyBlocks = { renderEmptyBlocks }
181186 />
182187 </ View >
183188 ) ;
@@ -217,6 +222,7 @@ const getBlocks = (params: ParamsType): ?Array<React$Element<*>> => {
217222 navigate = { navigate }
218223 defaultMarginLeft = { depthMargin }
219224 textProps = { textProps }
225+ renderEmptyBlocks = { renderEmptyBlocks }
220226 />
221227 </ View >
222228 ) ;
You can’t perform that action at this time.
0 commit comments