Skip to content

Commit

Permalink
Fix: [OV-44992] Added missing hasError prop to Tag in TagPicker
Browse files Browse the repository at this point in the history
  • Loading branch information
vicky-comeau committed Jul 7, 2023
1 parent 31645cf commit 8602a55
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/blue-moons-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@igloo-ui/tag-picker': patch
---

Tags in TagPicker were not receiving the hasError prop so it was added to fix this.
1 change: 1 addition & 0 deletions packages/TagPicker/src/TagPicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ export const Error = () => {
const select = (id: string): void => {
const selectedItem = mockData.find((d) => d.id === id);
if (selectedItem) {
selectedItem.hasError = true;
setSelected([...selected, selectedItem]);
} else {
setSelected([...selected]);
Expand Down
1 change: 1 addition & 0 deletions packages/TagPicker/src/TagPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ const TagPicker: React.FunctionComponent<TagPickerProps> = ({
dismissible={!disabled}
appearance="secondary"
onRemove={handleTagRemove}
hasError={s.hasError}
>
{s.text}
</Tag>
Expand Down
3 changes: 2 additions & 1 deletion packages/TagPicker/src/data.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';
import IconLockSolid from '@igloo-ui/icons/dist/LockSolid';
import { TagItem } from './TagPicker';

export const mockData = [
export const mockData: TagItem[] = [
{
id: '1',
text: 'A team',
Expand Down

0 comments on commit 8602a55

Please sign in to comment.