@@ -22,15 +22,15 @@ function ArrayFieldTitle({TitleField, idSchema, title, required}) {
2222 if ( ! title ) {
2323 return null ;
2424 }
25- const id = `${ idSchema . id } __title` ;
25+ const id = `${ idSchema . $ id} __title` ;
2626 return < TitleField id = { id } title = { title } required = { required } /> ;
2727}
2828
2929function ArrayFieldDescription ( { DescriptionField, idSchema, description} ) {
3030 if ( ! description ) {
3131 return null ;
3232 }
33- const id = `${ idSchema . id } __description` ;
33+ const id = `${ idSchema . $ id} __description` ;
3434 return < DescriptionField id = { id } description = { description } /> ;
3535}
3636
@@ -108,6 +108,7 @@ class ArrayField extends Component {
108108 onReorderClick = ( index , newIndex ) => {
109109 return ( event ) => {
110110 event . preventDefault ( ) ;
111+ event . target . blur ( ) ;
111112 const { items} = this . state ;
112113 this . asyncSetState ( {
113114 items : items . map ( ( item , i ) => {
@@ -184,7 +185,7 @@ class ArrayField extends Component {
184185 < div className = "row array-item-list" > {
185186 items . map ( ( item , index ) => {
186187 const itemErrorSchema = errorSchema ? errorSchema [ index ] : undefined ;
187- const itemIdPrefix = idSchema . id + "_" + index ;
188+ const itemIdPrefix = idSchema . $ id + "_" + index ;
188189 const itemIdSchema = toIdSchema ( itemsSchema , itemIdPrefix , definitions ) ;
189190 return this . renderArrayFieldItem ( {
190191 index,
@@ -215,7 +216,7 @@ class ArrayField extends Component {
215216 const Widget = ( multipleCheckboxes ) ? CheckboxesWidget : SelectWidget ;
216217 return (
217218 < Widget
218- id = { idSchema && idSchema . id }
219+ id = { idSchema && idSchema . $ id}
219220 multiple
220221 onChange = { this . onSelectChange }
221222 options = { { enumOptions : optionsList ( itemsSchema ) } }
@@ -234,7 +235,7 @@ class ArrayField extends Component {
234235 const { items} = this . state ;
235236 return (
236237 < FileWidget
237- id = { idSchema && idSchema . id }
238+ id = { idSchema && idSchema . $ id}
238239 multiple
239240 onChange = { this . onSelectChange }
240241 schema = { schema }
@@ -286,7 +287,7 @@ class ArrayField extends Component {
286287 const additional = index >= itemSchemas . length ;
287288 const itemSchema = additional ?
288289 additionalSchema : itemSchemas [ index ] ;
289- const itemIdPrefix = idSchema . id + "_" + index ;
290+ const itemIdPrefix = idSchema . $ id + "_" + index ;
290291 const itemIdSchema = toIdSchema ( itemSchema , itemIdPrefix , definitions ) ;
291292 const itemUiSchema = additional ?
292293 uiSchema . additionalItems || { } :
@@ -330,6 +331,7 @@ class ArrayField extends Component {
330331 const { SchemaField} = this . props . registry . fields ;
331332 const { disabled, readonly} = this . props ;
332333 const hasToolbar = removable || canMoveUp || canMoveDown ;
334+ const btnStyle = { flex : 1 , paddingLeft : 6 , paddingRight : 6 , fontWeight : "bold" } ;
333335
334336 return (
335337 < div key = { index } className = "array-item" >
@@ -352,24 +354,24 @@ class ArrayField extends Component {
352354 < div className = "btn-group" style = { { display : "flex" } } >
353355 { canMoveUp || canMoveDown ?
354356 < button type = "button" className = "btn btn-default array-item-move-up"
355- style = { { flex : 1 , paddingLeft : 6 , paddingRight : 6 } }
357+ style = { btnStyle }
356358 tabIndex = "-1"
357359 disabled = { disabled || readonly || ! canMoveUp }
358360 onClick = { this . onReorderClick ( index , index - 1 ) } > ⬆</ button >
359361 : null }
360362 { canMoveUp || canMoveDown ?
361363 < button type = "button" className = "btn btn-default array-item-move-down"
362- style = { { flex : 1 , paddingLeft : 6 , paddingRight : 6 } }
364+ style = { btnStyle }
363365 tabIndex = "-1"
364366 disabled = { disabled || readonly || ! canMoveDown }
365367 onClick = { this . onReorderClick ( index , index + 1 ) } > ⬇</ button >
366368 : null }
367369 { removable ?
368370 < button type = "button" className = "btn btn-danger array-item-remove"
369- style = { { flex : 1 , paddingLeft : 6 , paddingRight : 6 } }
371+ style = { btnStyle }
370372 tabIndex = "-1"
371373 disabled = { disabled || readonly }
372- onClick = { this . onDropIndexClick ( index ) } > ✖︎ </ button >
374+ onClick = { this . onDropIndexClick ( index ) } > ✖</ button >
373375 : null }
374376 </ div >
375377 </ div >
@@ -386,7 +388,7 @@ function AddButton({onClick, disabled}) {
386388 < p className = "col-xs-2 col-xs-offset-10 array-item-add text-right" >
387389 < button type = "button" className = "btn btn-info col-xs-12"
388390 tabIndex = "-1" onClick = { onClick }
389- disabled = { disabled } style = { { fontWeight : "bold" } } > + </ button >
391+ disabled = { disabled } style = { { fontWeight : "bold" } } > ➕ </ button >
390392 </ p >
391393 </ div >
392394 ) ;
0 commit comments