Skip to content

Commit

Permalink
fix(editor-ui): Fix ParameterInput inputField ref focus (n8n-io#4215)
Browse files Browse the repository at this point in the history
* fix(editor-ui): Fix ParameterInput inputField ref focus

* 🐛 Add focus method for `CredentialsSelect` and revert previous change to `ParamterInput`
  • Loading branch information
OlegIvaniv authored Sep 28, 2022
1 parent ad9104f commit 902e2c4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/editor-ui/src/components/CredentialsSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
:value="displayValue"
:placeholder="parameter.placeholder ? getPlaceholder() : $locale.baseText('parameterInput.select')"
:title="displayTitle"
ref="innerSelect"
@change="(value) => $emit('valueChanged', value)"
@keydown.stop
@focus="$emit('setFocus')"
Expand Down Expand Up @@ -82,6 +83,12 @@ export default Vue.extend({
},
},
methods: {
focus() {
const select = this.$refs.innerSelect as Vue & HTMLElement | undefined;
if (select) {
select.focus();
}
},
/**
* Check if a credential type belongs to one of the supported sets defined
* in the `credentialTypes` key in a `credentialsSelect` parameter
Expand Down

0 comments on commit 902e2c4

Please sign in to comment.