Skip to content

Commit

Permalink
Hide clear for segmented-control
Browse files Browse the repository at this point in the history
  • Loading branch information
u-ishii committed Jun 16, 2022
1 parent 00ce590 commit d53ea97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/forty-stingrays-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-6/core': patch
---

Hide the clear button if is-required is true for segmented-control
2 changes: 1 addition & 1 deletion packages/core/src/fields/types/select/views/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const Field = ({
setHasChanged(true);
}}
/>
{value.value !== null && onChange !== undefined && (
{value.value !== null && onChange !== undefined && !field.isRequired && (
<Button
onClick={() => {
onChange({ ...value, value: null });
Expand Down

0 comments on commit d53ea97

Please sign in to comment.