Skip to content

Commit db58601

Browse files
committed
fix keyword deletion from single item (via pills)
1 parent e7d5e3f commit db58601

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

frontend/packages/volto-keywordmanager/src/components/KeywordView.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,11 @@ const KeywordView = (props) => {
169169
}));
170170

171171
const handleDeleteKeywords = async (kw: string | string[], id?: string) => {
172-
if (typeof kw == 'string') {
173-
kw = [kw];
174-
}
172+
const result = Array.isArray(kw) ? kw : [kw];
175173
setIsLoading(true);
176174
try {
177175
await dispatch(
178-
deleteKeywords({ items: kw, path: id, indexName: keywordIndex }),
176+
deleteKeywords({ items: result, path: id, indexName: keywordIndex }),
179177
);
180178
toast.success(
181179
<Toast title="Delete Success" content="Deleted successfully!" />,

frontend/packages/volto-keywordmanager/src/theme/_main.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,15 @@
300300
background: #d1d6f1;
301301
}
302302

303+
&.normal {
304+
border: none;
305+
background: none;
306+
307+
&:hover {
308+
text-decoration: underline;
309+
}
310+
}
311+
303312
button {
304313
padding: 0;
305314
border: none;

0 commit comments

Comments
 (0)