Skip to content

Commit

Permalink
Add loading icon to TagPicker (#2118)
Browse files Browse the repository at this point in the history
  • Loading branch information
amoedoamorim authored Sep 20, 2024
1 parent 63b0438 commit a90796b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/components/cds/menus-lists-dialogs/TagPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const TagPicker = ({
customCreateLabel,
hasMore,
loadMore,
loading,
options: teamTags,
readOnly,
saving,
Expand Down Expand Up @@ -98,6 +99,7 @@ const TagPicker = ({
}
hasMore={hasMore}
inputPlaceholder={placeholder}
loadingIcon={loading && <MediasLoading size="small" theme="white" variant="inline" />}
notFoundLabel={
<FormattedMessage
defaultMessage="No tags found"
Expand Down
3 changes: 3 additions & 0 deletions src/app/components/media/TeamTagsQueryRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ const TeamTagsQueryRenderer = ({
render={({ error, props }) => {
if (error) return null;

const loading = Boolean(!error && !props);

// TODO: This "merge selected tags with plainTagsTexts" logic is identical
// to `SearchFieldTag` component. Evaluate reusing TeamTagsQueryRenderer there.

Expand All @@ -75,6 +77,7 @@ const TeamTagsQueryRenderer = ({
<TagPicker
hasMore={hasMore}
loadMore={handleLoadMore}
loading={loading}
options={plainTagsTexts.map(t => ({ label: t, value: t }))}
readOnly={readOnly}
searchTerm={keyword}
Expand Down

0 comments on commit a90796b

Please sign in to comment.