Make TagAddButton focusable and simulate click on focus (#1838)

This commit is contained in:
Henrik Giesel 2022-05-07 01:15:58 +02:00 committed by GitHub
parent c8a4e5ea22
commit 1ec227d926
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,13 +13,19 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
const dispatch = createEventDispatcher<{ tagappend: CustomEvent<void> }>();
function appendTag() {
dispatch("tagappend");
}
const keyCombination = "Control+Shift+T";
</script>
<div
class="tag-add-button"
title="{tr.editingTagsAdd()} ({getPlatformString(keyCombination)})"
on:click={() => dispatch("tagappend")}
tabindex={0}
on:click={appendTag}
on:focus={appendTag}
>
<IconConstrain>
{@html tagIcon}