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:
Max Schmitt 2024-03-25 23:12:36 +01:00
parent 8a73182908
commit fb9d1c1a4a

View file

@ -137,14 +137,15 @@ export const TestListView: React.FC<{
const handleTagClick = (e: React.MouseEvent, tag: string) => {
e.preventDefault();
e.stopPropagation();
if (e.metaKey) {
if (e.metaKey || e.ctrlKey) {
const parts = filterText.split(' ');
if (parts.includes(tag))
setFilterText(parts.filter(t => t !== tag).join(' '));
else
setFilterText((filterText + ' ' + tag).trim());
} else {
setFilterText(tag);
// Replace all existing tags with this tag.
setFilterText(filterText.split(' ').filter(t => !t.startsWith('@')).join(' ') + ' ' + tag);
}
};