Skip to content

Commit

Permalink
fix(form-builder): disable TagInput when in read-only mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuslundgard authored and bjoerge committed Apr 8, 2021
1 parent eb3062f commit 7828c61
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,11 @@ export const TagInput = forwardRef(
padding={1}
ref={rootRef}
>
<Placeholder hidden={Boolean(inputValue || value.length)} padding={3}>
<Text textOverflow="ellipsis">{placeholder}</Text>
</Placeholder>
{enabled && (
<Placeholder hidden={Boolean(inputValue || value.length)} padding={3}>
<Text textOverflow="ellipsis">{placeholder}</Text>
</Placeholder>
)}

<div className="content">
{value.map((tag, tagIndex) => (
Expand All @@ -257,7 +259,7 @@ export const TagInput = forwardRef(
<div key="tag-input">
<Input
{...restProps}
disabled={disabled}
disabled={!enabled}
onBlur={handleInputBlur}
onChange={handleInputChange}
onFocus={handleInputFocus}
Expand Down

0 comments on commit 7828c61

Please sign in to comment.