Skip to content

Commit

Permalink
make Semantic-UI's AddButton not show an empty label (#3142)
Browse files Browse the repository at this point in the history
* fix: make AddButton not show an empty label

* Update semantic-ui test snapshots (#2590)

Co-authored-by: Heath C <[email protected]>
  • Loading branch information
LucienLeMagicien and heath-freenome authored Sep 23, 2022
1 parent e16fc65 commit a759402
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ should change the heading of the (upcoming) version to include a major version b
## @rjsf/semantic-ui
- Updated the `FieldErrorTemplate` to use the `children` variation of the `List.Item` that supports ReactElement
- Pass `uiSchema` appropriately to all of the `IconButton`s, `ArrayFieldItemTemplate` and `WrapIfAdditional` components, fixing (https://github.com/rjsf-team/react-jsonschema-form/issues/3130)
- Fixed `ArrayFieldTemplate` and `ObjectFieldTemplate`'s `AddButton` to show the non-labeled version. (https://github.com/rjsf-team/react-jsonschema-form/pull/3142)

## @rjsf/utils
- Updated the `FieldErrorProps` type to make it support an array of string and ReactElement
Expand Down
2 changes: 1 addition & 1 deletion packages/semantic-ui/src/AddButton/AddButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Button, Icon } from "semantic-ui-react";

function AddButton({ uiSchema, ...props }) {
return (
<Button title="Add Item" {...props} icon size="tiny" labelPosition="left">
<Button title="Add Item" {...props} icon size="tiny">
<Icon name="plus" />
</Button>
);
Expand Down
4 changes: 2 additions & 2 deletions packages/semantic-ui/test/__snapshots__/Array.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ exports[`array fields array 1`] = `
}
>
<button
className="ui tiny icon left labeled button"
className="ui tiny icon button"
onClick={[Function]}
title="Add Item"
>
Expand Down Expand Up @@ -268,7 +268,7 @@ exports[`array fields array icons 1`] = `
}
>
<button
className="ui tiny icon left labeled button"
className="ui tiny icon button"
onClick={[Function]}
title="Add Item"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ exports[`object fields additionalProperties 1`] = `
}
>
<button
className="ui tiny icon left labeled button"
className="ui tiny icon button"
onClick={[Function]}
title="Add Item"
>
Expand Down

0 comments on commit a759402

Please sign in to comment.