Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/super-editor/src/components/toolbar/ButtonGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ const getDropdownAttributes = (option, item) => {
};

const handleClickOutside = (e) => {
const target = e.target;
const itemCtn = target.closest('.toolbar-item-ctn');
const targetItemId = itemCtn?.dataset.itemId;

if (targetItemId === currentItem.value.id) {
return;
}

closeDropdowns();
};

Expand Down Expand Up @@ -166,7 +174,6 @@ const handleKeyDown = (e, item) => {

switch (e.key) {
case 'Enter':
console.log('Enter');
handleToolbarButtonClick(item, null, false);
break;
case 'Escape':
Expand Down Expand Up @@ -215,6 +222,7 @@ const handleFocus = (e) => {
class="toolbar-item-ctn"
ref="toolbarItemRefs"
:tabindex="index === 0 ? 0 : -1"
:data-item-id="item.id.value"
>
<!-- toolbar separator -->
<ToolbarSeparator v-if="isSeparator(item)" style="width: 20px" />
Expand Down
Loading