fix(editor): Fix for execution retry dropdown not closing (#4575)

* 🐛 Fixing execution retry popup closing behavior
* 👌 Updating child component ref type casting
* 👌 Handling `undefined` possibility in action dropdown blur event
This commit is contained in:
Milorad FIlipović
2022-11-14 09:35:16 +01:00
committed by GitHub
parent c1bcc47cb5
commit e0ec5a6aa9
3 changed files with 24 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div :class="['action-dropdown-container', $style.actionDropdownContainer]">
<el-dropdown :placement="placement" :trigger="trigger" @command="onSelect">
<div :class="$style.activator" @click.prevent>
<el-dropdown :placement="placement" :trigger="trigger" @command="onSelect" ref="elementDropdown">
<div :class="$style.activator" @click.prevent @blur="onButtonBlur">
<n8n-icon :icon="activatorIcon"/>
</div>
<el-dropdown-menu slot="dropdown" :class="$style.userActionsMenu">
@@ -92,6 +92,13 @@ export default Vue.extend({
onSelect(action: string) : void {
this.$emit('select', action);
},
onButtonBlur(event: FocusEvent): void {
const elementDropdown = this.$refs.elementDropdown as Vue & { hide: () => void } | undefined;
// Hide dropdown when clicking outside of current document
if (elementDropdown && event.relatedTarget === null) {
elementDropdown.hide();
}
},
},
});