Update packages/trace-viewer/src/ui/uiModeTestListView.tsx
Co-authored-by: Dmitry Gozman <dgozman@gmail.com> Signed-off-by: Max Schmitt <max@schmitt.mx>
This commit is contained in:
parent
8a73182908
commit
fb9d1c1a4a
|
|
@ -137,14 +137,15 @@ export const TestListView: React.FC<{
|
||||||
const handleTagClick = (e: React.MouseEvent, tag: string) => {
|
const handleTagClick = (e: React.MouseEvent, tag: string) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
if (e.metaKey) {
|
if (e.metaKey || e.ctrlKey) {
|
||||||
const parts = filterText.split(' ');
|
const parts = filterText.split(' ');
|
||||||
if (parts.includes(tag))
|
if (parts.includes(tag))
|
||||||
setFilterText(parts.filter(t => t !== tag).join(' '));
|
setFilterText(parts.filter(t => t !== tag).join(' '));
|
||||||
else
|
else
|
||||||
setFilterText((filterText + ' ' + tag).trim());
|
setFilterText((filterText + ' ' + tag).trim());
|
||||||
} else {
|
} else {
|
||||||
setFilterText(tag);
|
// Replace all existing tags with this tag.
|
||||||
|
setFilterText(filterText.split(' ').filter(t => !t.startsWith('@')).join(' ') + ' ' + tag);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue