Skip to content

Commit 2f19c19

Browse files
committed
Fix rjsf-team#337 with normal plus and css transform, and fix plus icon alignment in narrow forms
1 parent e7b2c4d commit 2f19c19

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/fields/ArrayField.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
} from "../../utils";
1717
import FileWidget from "./../widgets/FileWidget";
1818

19+
const btnStyle = {flex: 1, paddingLeft: 6, paddingRight: 6, fontWeight: "bold"};
1920

2021
function ArrayFieldTitle({TitleField, idSchema, title, required}) {
2122
if (!title) {
@@ -345,7 +346,6 @@ class ArrayField extends Component {
345346

346347
const hasToolbar = removable || _canMoveUp || _canMoveDown;
347348

348-
const btnStyle = {flex: 1, paddingLeft: 6, paddingRight: 6, fontWeight: "bold"};
349349

350350
return (
351351
<div key={index} className="array-item">
@@ -398,12 +398,16 @@ class ArrayField extends Component {
398398
}
399399

400400
function AddButton({onClick, disabled}) {
401+
const plusStyle = {transform: 'scale(1.6)', transformOrigin: '50% 70%'};
401402
return (
402403
<div className="row">
403404
<p className="col-xs-2 col-xs-offset-10 array-item-add text-right">
404405
<button type="button" className="btn btn-info col-xs-12"
406+
style={btnStyle}
405407
tabIndex="-1" onClick={onClick}
406-
disabled={disabled} style={{fontWeight: "bold"}}></button>
408+
disabled={disabled}>
409+
<div style={plusStyle}>+</div>
410+
</button>
407411
</p>
408412
</div>
409413
);

0 commit comments

Comments
 (0)