mirror of
https://github.com/node-red/node-red.git
synced 2025-12-27 15:34:26 +01:00
Update context on autoComplete api
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
if (plugins.length > 0) {
|
||||
this.options.search = async function (value, done) {
|
||||
// for now, only support a single plugin
|
||||
const promises = plugins.map(plugin => plugin.getCompletions(value, that.options.node))
|
||||
const promises = plugins.map(plugin => plugin.getCompletions(value, that.options.context))
|
||||
const completions = (await Promise.all(promises)).flat()
|
||||
const results = []
|
||||
completions.forEach(completion => {
|
||||
|
||||
@@ -481,7 +481,9 @@
|
||||
input.autoComplete({
|
||||
minLength: 0,
|
||||
completionPluginType: 'node-red-mqtt-topic-autocomplete-source',
|
||||
node
|
||||
context: {
|
||||
node
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user